engine: resources: exec: Fix wrong err variable being checked in test
This commit is contained in:
committed by
James Shubin
parent
d56896cb0d
commit
63d7b8e51e
@@ -412,7 +412,7 @@ func TestExecTimeoutBehaviour(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exitErr, ok := err.(*exec.ExitError) // embeds an os.ProcessState
|
exitErr, ok := err.(*exec.ExitError) // embeds an os.ProcessState
|
||||||
if err != nil && ok {
|
if ok {
|
||||||
pStateSys := exitErr.Sys() // (*os.ProcessState) Sys
|
pStateSys := exitErr.Sys() // (*os.ProcessState) Sys
|
||||||
wStatus, ok := pStateSys.(syscall.WaitStatus)
|
wStatus, ok := pStateSys.(syscall.WaitStatus)
|
||||||
if !ok {
|
if !ok {
|
||||||
@@ -432,13 +432,8 @@ func TestExecTimeoutBehaviour(t *testing.T) {
|
|||||||
|
|
||||||
t.Logf("exit status: %d", wStatus.ExitStatus())
|
t.Logf("exit status: %d", wStatus.ExitStatus())
|
||||||
return
|
return
|
||||||
|
|
||||||
} else if err != nil {
|
|
||||||
t.Errorf("general cmd error")
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
t.Errorf("general cmd error")
|
||||||
// no error
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestExecAutoEdge1(t *testing.T) {
|
func TestExecAutoEdge1(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user