engine: resources: exec: Fix wrong err variable being checked in test

This commit is contained in:
Edward Toroshchyn
2025-02-23 13:51:13 +01:00
committed by James Shubin
parent d56896cb0d
commit 63d7b8e51e

View File

@@ -412,7 +412,7 @@ func TestExecTimeoutBehaviour(t *testing.T) {
}
exitErr, ok := err.(*exec.ExitError) // embeds an os.ProcessState
if err != nil && ok {
if ok {
pStateSys := exitErr.Sys() // (*os.ProcessState) Sys
wStatus, ok := pStateSys.(syscall.WaitStatus)
if !ok {
@@ -432,13 +432,8 @@ func TestExecTimeoutBehaviour(t *testing.T) {
t.Logf("exit status: %d", wStatus.ExitStatus())
return
} else if err != nil {
t.Errorf("general cmd error")
return
}
// no error
t.Errorf("general cmd error")
}
func TestExecAutoEdge1(t *testing.T) {