fix(ci): skip linux egress fallback test + deflake OAuth poll-cancel test - #13
Merged
Merged
Conversation
TestApplyEgressRules_FallbackBehavior is documented as testing the non-Linux fallback path of applyEgressRules, but it has no build tag gating it. On Linux CI it picks up the real nftables applier, which calls nft.New() — that opens a netlink socket and fails without CAP_NET_ADMIN, killing make test. Skip with runtime.GOOS check rather than splitting into a !linux- tagged file so the test stays adjacent to its sibling translate + teardown tests. Linux-side coverage of applyEgressRules already lives in egress_linux_test.go behind a root-only gate. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Cancel ctx up-front instead of racing a sleep-then-cancel goroutine against the poll loop — the previous version was flaky on loaded CI runners (macos-14 in particular). Also switch the error assertion from string match on "cancelled" to errors.Is(err, context.Canceled) so a future refactor of the wrap message doesn't silently break the test. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Two CI-blocking test issues fixed:
`TestApplyEgressRules_FallbackBehavior` (Linux only) — the test calls `applyEgressRules` which on Linux hits real nftables and needs CAP_NET_ADMIN. CI runners lack it. Added a `runtime.GOOS == "linux"` skip — the Linux integration coverage lives in `egress_linux_test.go` behind a root gate already.
`TestPollForGitHubToken_Cancel` (macOS flake) — the previous version raced a sleep-then-cancel goroutine against the poll loop. On loaded runners the cancel could arrive after the test's expected window. Cancel up-front instead so the first poll deterministically observes `ctx.Err()`. Also replaced the brittle `strings.Contains(err, "cancelled")` (British spelling) assertion with `errors.Is(err, context.Canceled)`.
Test plan
Unblocks PR #9 and PR #12 once merged.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com