You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(test): TestResolveAllowedIP_Timeout is flaky in CI #1506
TestResolveAllowedIP_Timeout in backend/internal/utils/url_testing_security_test.go fails intermittently in CI with Expected timeout error, got nil.
Evidence
Failed in Backend (Go) on release PR chore(main): release 0.44.3 #1504 (run 37572083310, job 112632740951): FAIL: internal/utils TestResolveAllowedIP_Timeout (0.00s), the only failure out of 10273 tests.
The test passes context.WithTimeout(ctx, 1*time.Nanosecond) and expects resolveAllowedIP(ctx, "example.com", false) to return an error. Whether the deadline is observed before the resolver returns (cached or hosts-file answer, fast local resolver) is racy, so the result depends on timing and the environment.
Severity
Medium (CI flake). It fails a required check on unrelated branches, and CLAUDE.md forbids deferring failing tests.
Suggested approach
Make it deterministic: cancel the context before the call (cancel() then call), or use a context whose deadline is already in the past, and assert errors.Is(err, context.Canceled) / DeadlineExceeded. Also check that resolveAllowedIP checks ctx.Err() up front so an already-expired context always fails, and make the final assertion a t.Errorf instead of a t.Logf so it actually guards the behavior.
Problem
TestResolveAllowedIP_Timeoutinbackend/internal/utils/url_testing_security_test.gofails intermittently in CI withExpected timeout error, got nil.Evidence
Backend (Go)on release PR chore(main): release 0.44.3 #1504 (run 37572083310, job 112632740951):FAIL: internal/utils TestResolveAllowedIP_Timeout (0.00s), the only failure out of 10273 tests.main(run 37570500238), on the PR fix(security): harden backend consistency checks #1500 branch, and locally, with identical code.context.WithTimeout(ctx, 1*time.Nanosecond)and expectsresolveAllowedIP(ctx, "example.com", false)to return an error. Whether the deadline is observed before the resolver returns (cached or hosts-file answer, fast local resolver) is racy, so the result depends on timing and the environment.Severity
Medium (CI flake). It fails a required check on unrelated branches, and
CLAUDE.mdforbids deferring failing tests.Suggested approach
Make it deterministic: cancel the context before the call (
cancel()then call), or use a context whose deadline is already in the past, and asserterrors.Is(err, context.Canceled)/DeadlineExceeded. Also check thatresolveAllowedIPchecksctx.Err()up front so an already-expired context always fails, and make the final assertion at.Errorfinstead of at.Logfso it actually guards the behavior.