[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.
This commit is contained in:
mlsmaycon
2026-08-12 06:02:19 +00:00
parent f4d2b56420
commit 910fef5406

View File

@@ -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")
}