From 910fef54063a0a561da237452cad37f464d1b38d Mon Sep 17 00:00:00 2001 From: mlsmaycon Date: Wed, 12 Aug 2026 06:02:19 +0000 Subject: [PATCH] [infrastructure] Assert the cancellation error, not just any error A non-nil check passes for a lookup that failed for some unrelated reason, which would let the context handling regress unnoticed. exec.Cmd.Start returns the context's own error when it is already done, so the wrapped error carries context.Canceled and can be asserted directly. --- e2e/harness/options_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/harness/options_test.go b/e2e/harness/options_test.go index 9ebeba55c..8a5557a83 100644 --- a/e2e/harness/options_test.go +++ b/e2e/harness/options_test.go @@ -157,5 +157,5 @@ func TestModuleDirHonoursContext(t *testing.T) { cancel() _, err := moduleDir(ctx, modulePath) - assert.Error(t, err, "a cancelled context must fail the lookup") + assert.ErrorIs(t, err, context.Canceled, "a cancelled context must stop the lookup") }