fix(executor/local): wait after kill
This commit is contained in:
parent
33d26be20c
commit
a53cb6451e
|
@ -27,6 +27,9 @@ func (e *Local) generateResult(
|
||||||
ExitStatus: processState.ExitCode(),
|
ExitStatus: processState.ExitCode(),
|
||||||
Error: "",
|
Error: "",
|
||||||
Time: func() uint64 {
|
Time: func() uint64 {
|
||||||
|
if isTimeout {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
nanos := processState.UserTime().Nanoseconds()
|
nanos := processState.UserTime().Nanoseconds()
|
||||||
if nanos < 0 {
|
if nanos < 0 {
|
||||||
return 0
|
return 0
|
||||||
|
@ -148,8 +151,9 @@ func (e *Local) Run(cmds []stage.Cmd) ([]stage.ExecutorResult, error) {
|
||||||
results = append(results, result)
|
results = append(results, result)
|
||||||
case <-time.After(duration):
|
case <-time.After(duration):
|
||||||
_ = execCmd.Process.Kill()
|
_ = execCmd.Process.Kill()
|
||||||
|
err := execCmd.Wait()
|
||||||
result := e.generateResult(
|
result := e.generateResult(
|
||||||
nil,
|
err,
|
||||||
execCmd.ProcessState,
|
execCmd.ProcessState,
|
||||||
duration,
|
duration,
|
||||||
cmd,
|
cmd,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user