Merge pull request #5941 from thaJeztah/TestUserTerminatedError_handle_errs

cmd/dockerd: TestUserTerminatedError: fix unhandled errors
This commit is contained in:
Paweł Gronowski
2025-03-25 10:01:34 +00:00
committed by GitHub

View File

@ -87,7 +87,7 @@ func TestUserTerminatedError(t *testing.T) {
notifyCtx, cancelNotify := notifyContext(ctx, platformsignals.TerminationSignals...)
t.Cleanup(cancelNotify)
syscall.Kill(syscall.Getpid(), syscall.SIGINT)
assert.Check(t, syscall.Kill(syscall.Getpid(), syscall.SIGINT))
<-notifyCtx.Done()
assert.ErrorIs(t, context.Cause(notifyCtx), errCtxSignalTerminated{
@ -99,7 +99,7 @@ func TestUserTerminatedError(t *testing.T) {
notifyCtx, cancelNotify = notifyContext(ctx, platformsignals.TerminationSignals...)
t.Cleanup(cancelNotify)
syscall.Kill(syscall.Getpid(), syscall.SIGTERM)
assert.Check(t, syscall.Kill(syscall.Getpid(), syscall.SIGTERM))
<-notifyCtx.Done()
assert.ErrorIs(t, context.Cause(notifyCtx), errCtxSignalTerminated{