Skip to content

fix(test): retry transparent gateway egress check in verify_gateway - #121

Merged
hapheus merged 2 commits into
mainfrom
fix/issue-119-gateway-egress-retries
Nov 7, 2026
Merged

hapheus merged 2 commits into
mainfrom
fix/issue-119-gateway-egress-retries

Conversation

@hapheus

@hapheus hapheus commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Closes #120

Context

After PR #118 merged and the new image published, the first daily canary run failed in 'Verify Transparent Tor Gateway Mode': the gateway container bootstrapped fine and every netfilter check passed, but the single transparent-egress curl to check.torproject.org died with curl exit 55. A manual re-run of the identical published image passed, and the canary alert (#116) auto-closed — so this was a transient external flake, not a product regression.

Change

tests/integration/verify_gateway.sh now retries the transparent egress check up to 4 times (with curl --retry 2 --retry-all-errors and 3s backoff), matching the HTTP/SOCKS egress checks in the live canary. Any real leak still fails after the retries.

Verification

  • bash -n + shellcheck clean
  • uv run pytest tests/unit/ --cov-fail-under=85: 352 passed, 86.88%
  • CI: PR gate incl. live verification (which exercises this script in gateway mode)

A single curl attempt against check.torproject.org over a fresh
circuit flaked in the daily canary (curl exit 55) although the
gateway was healthy; the manual re-run passed. Retry up to 4
times like the other canary egress checks, then fail.
Gateway bootstrap polls waited for /status connected, which
additionally requires the external check.torproject.org egress
probe. Its intermittent unreachability from CI runners flaked
the step (PR #121 smoke run) although Tor reached 100% in
seconds. Poll /health tor.progress == 100 instead; egress
itself is verified separately by verify_gateway.sh.

@MustermenschAlex MustermenschAlex left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid hardening: retries match the other egress checks, and switching the gateway bootstrap wait to /health tor.progress removes the hidden dependency on the external check service without weakening the actual egress assertion in verify_gateway.sh. All checks green. Approving.

@kuenstlichedummheit-sys kuenstlichedummheit-sys left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flake-hunting done right: first the retry, then noticing the bootstrap poll itself was hostage to check.torproject.org. Waiting on progress 100 instead of a full egress round-trip is the honest signal here. Green across the board, ship it.

@majorungustl majorungustl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exactly how it should be: less coupled to a flaky external service for the bootstrap wait, and the real leak checks stay strict with retries. Small diff, big reliability win. LGTM.

@hapheus
hapheus merged commit 8728fa9 into main Nov 7, 2026
12 checks passed
@hapheus
hapheus deleted the fix/issue-119-gateway-egress-retries branch November 10, 2026 08:12
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.

fix(test): retry transparent gateway egress check (daily canary flake, curl exit 55)

4 participants