fix(executor/local): wait after kill
All checks were successful
submodules sync / sync (push) Successful in 39s
build / build (push) Successful in 2m14s
build / trigger-build-image (push) Successful in 13s

This commit is contained in:
张泊明518370910136 2025-03-21 01:38:38 -04:00
parent 33d26be20c
commit a53cb6451e
GPG Key ID: D47306D7062CDA9D

View File

@ -27,6 +27,9 @@ func (e *Local) generateResult(
ExitStatus: processState.ExitCode(),
Error: "",
Time: func() uint64 {
if isTimeout {
return 0
}
nanos := processState.UserTime().Nanoseconds()
if nanos < 0 {
return 0
@ -148,8 +151,9 @@ func (e *Local) Run(cmds []stage.Cmd) ([]stage.ExecutorResult, error) {
results = append(results, result)
case <-time.After(duration):
_ = execCmd.Process.Kill()
err := execCmd.Wait()
result := e.generateResult(
nil,
err,
execCmd.ProcessState,
duration,
cmd,