hooks/exec: Allow successful reaps for 0s post-kill timeouts

I'd been getting the failed-to-reap errors locally, but on an
unrelated pull-request the FAH27 suite successfully reaped that hook
[1]:

  --- FAIL: TestRunKillTimeout (0.50s)
  	assertions.go:226:

  	Error Trace:	exec_test.go:210

  	Error:      	Expect "signal: killed" to match "^failed to reap process within 0s of the kill signal$"
  FAIL

The successful-reap cases limit our coverage, but I don't think that's
a big enough problem to be worth repeated polling or similar until we
do get the failed-to-reap error.

[1]: 96c1535fdc.0.1527811547665239762/output.log

Signed-off-by: W. Trevor King <wking@tremily.us>

Closes: #868
Approved by: rhatdan
This commit is contained in:
W. Trevor King
2018-05-31 17:17:59 -07:00
committed by Atomic Bot
parent a9e9fd4f5b
commit 34886a79d6

View File

@ -207,7 +207,7 @@ func TestRunKillTimeout(t *testing.T) {
}
hookErr, err := Run(ctx, hook, []byte("{}"), nil, nil, time.Duration(0))
assert.Equal(t, context.DeadlineExceeded, err)
assert.Regexp(t, "^failed to reap process within 0s of the kill signal$", hookErr)
assert.Regexp(t, "^(failed to reap process within 0s of the kill signal|signal: killed)$", hookErr)
}
func init() {