mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #16252 from gocurr/avoid_hardcoding
pkg/expect: avoid hardcoding when checking ErrProcessDone
This commit is contained in:
commit
7aad281317
@ -286,7 +286,7 @@ func (ep *ExpectProcess) ExitError() error {
|
|||||||
// Stop signals the process to terminate via SIGTERM
|
// Stop signals the process to terminate via SIGTERM
|
||||||
func (ep *ExpectProcess) Stop() error {
|
func (ep *ExpectProcess) Stop() error {
|
||||||
err := ep.Signal(syscall.SIGTERM)
|
err := ep.Signal(syscall.SIGTERM)
|
||||||
if err != nil && strings.Contains(err.Error(), "os: process already finished") {
|
if err != nil && errors.Is(err, os.ErrProcessDone) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user