Skip to content

fix(ci): skip linux egress fallback test + deflake OAuth poll-cancel test - #13

Merged
MikeBengtson merged 2 commits into
mainfrom
fix/ci-lint
May 15, 2026
Merged

MikeBengtson merged 2 commits into
mainfrom
fix/ci-lint

Conversation

@MikeBengtson

@MikeBengtson MikeBengtson commented May 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Two CI-blocking test issues fixed:

  1. `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.

  2. `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

  • `go test ./internal/adapter/firecracker/... ./internal/cli/...` — 338 pass
  • `go test -count=10 -run TestPollForGitHubToken_Cancel ./internal/cli/...` — 10/10 pass under stress
  • `golangci-lint run --timeout=2m` — 0 issues

Unblocks PR #9 and PR #12 once merged.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

MikeBengtson and others added 2 commits May 14, 2026 13:43
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>
@MikeBengtson MikeBengtson changed the title fix(ci): skip fallback egress test on linux to unblock make test fix(ci): skip linux egress fallback test + deflake OAuth poll-cancel test May 14, 2026
@MikeBengtson
MikeBengtson merged commit 598370a into main May 15, 2026
4 of 6 checks passed
@MikeBengtson
MikeBengtson deleted the fix/ci-lint branch May 15, 2026 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant