Repository navigation
chore(test): loosen port-literal assertions that flaked on auto-bump - #127
Conversation
Three pre-existing test failures were all the same shape: assertions hardcoded port 7549 (the test harness's chosen non-default port), but when 7549 was already held by an earlier test's not-yet-reaped python listener, airc's host-mode auto-bump kicks 7549 → 7550 → 7551 → ... and the assertion fails on the wrong number. The auto-bump behavior is correct (it's what makes overlapping test runs possible); the test expectations were too literal. Loosened assertions: - scenario_tabs ":port missing from join string" → match `:[0-9]+#` (any explicit port-suffix proves AIRC_PORT override took effect). - scenario_status "host status missing port" → match 'hosting on port [0-9]+' (any port). - scenario_status "joiner status missing host port" → match `:[0-9]+` (any host port suffix). Verified: scenario_tabs 19/19, scenario_status 7/7. No code changes — this is purely test-flake hardening. Two more pre-existing failures remain (port 7549 still held after teardown / outage simulation) — those are real teardown-thoroughness issues, NOT assertion flakes; deferred to a separate PR if/when needed. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
Hardens the bash integration test suite against flakiness caused by airc auto-bumping off AIRC_PORT=7549 when the port is already in use (e.g., by an earlier test’s lingering listener), by loosening assertions to accept any numeric port.
Changes:
- Relax
scenario_tabsjoin-string assertion from a hardcoded:7549to “any explicit:portpresent”. - Relax
scenario_statushost/joiner status assertions to matchport [0-9]+and:[0-9]+rather than7549. - Expand inline comments explaining why port literals are intentionally not pinned.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # IS in the join string when AIRC_PORT was set non-default, not | ||
| # which exact number). | ||
| case "$join" in *":"[0-9]*"#"*) pass "explicit :port in join string (port override took effect)" ;; | ||
| *) fail ":port missing from join string (got: $join)" ;; |
There was a problem hiding this comment.
The failure branch prints the full join string ($join) which includes a long base64-encoded SSH public key and the local username/host. This can make CI logs noisy and harder to scan; consider truncating/redacting the token portion (similar to the earlier ${join:0:40}... pass message) while still including enough context to debug.
| *) fail ":port missing from join string (got: $join)" ;; | |
| *) fail ":port missing from join string (got: ${join:0:40}...)" ;; |
Three pre-existing test failures (':port missing', 'host status missing port', 'joiner status missing host port') were all the same shape: hardcoded
:7549literals failed when airc's auto-bump landed on 7550/7551/etc due to port-held-by-earlier-test. Loosened to match:[0-9]+/port [0-9]+patterns. No code changes; pure test hardening.scenario_tabs: 19/19. scenario_status: 7/7. Two failures remain (port-still-held-after-teardown), which are real teardown-thoroughness issues — not assertion flakes; deferred.
🤖 Generated with Claude Code