Repository navigation
[NO-TICKET] Keep the egress category test off the network - #356
Merged
Merged
Conversation
The egress case resolved a made-up hostname through real DNS before its hostname rule matched, so a slow resolver on the runner timed the test out and failed the Publish workflow. The case now sets screenDns: false, as the other hostname-rule egress tests do. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Test now disables DNS resolution preventing network calls during egress phase. 🎯 Quality: 90% Elite · 📦 Size: Tiny 📈 This month: Your 175th PR — above team average · Averaging Excellent |
Contributor
Author
|
/review |
daniloradovic
approved these changes
Oct 2, 2026
daniloradovic
approved these changes
Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The egress case in
tests/protect/every-phase-reports-the-rule-category.test.tsnow passesscreenDns: false. The test no longer makes a real DNS lookup, so it can't time out on a slow runner.Why it failed
The Publish workflow stopped at Validate package because this one test hit vitest's 5s timeout. Egress screening is on by default, and before any rule is checked it resolves the hostname to make sure it doesn't point at an internal address. The test calls
https://api.evil.com/x, so each run made a real DNS query from the CI runner. When that query was slow, the test ran past 5s. Nothing in the code under test was wrong.Fix
category. The rule matches on the hostname (egress.hostcontainsevil.com), so the DNS step was never part of what the test covers.egress-guard-lifecycle.test.ts,rule-shapes.test.ts).Verified
npm test: 4281 passed, 7 skipped.Out of scope, worth a follow-up
Other egress tests turn on
egress: truewithoutscreenDns: falseor a stubbedlookup. Any of them that calls a non-IP hostname also makes a real DNS query and can time out the same way. Giving the test setup a stub resolver by default would make the whole suite network-free, but that's a wider change than this fix.Docs: not needed. Test-only change.
Field test: none outstanding. No shipped docs, prompt or
dist/code changed.🤖 Generated with Claude Code