Skip to content

chore(test): loosen port-literal assertions that flaked on auto-bump - #127

Merged
joelteply merged 1 commit into
canaryfrom
chore/test-port-flake-loosen
Apr 26, 2026
Merged

joelteply merged 1 commit into
canaryfrom
chore/test-port-flake-loosen

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Three pre-existing test failures (':port missing', 'host status missing port', 'joiner status missing host port') were all the same shape: hardcoded :7549 literals 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

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]>
Copilot AI review requested due to automatic review settings April 26, 2026 18:14
@joelteply
joelteply merged commit 0d7e76a into canary Apr 26, 2026
@joelteply
joelteply deleted the chore/test-port-flake-loosen branch April 26, 2026 18:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_tabs join-string assertion from a hardcoded :7549 to “any explicit :port present”.
  • Relax scenario_status host/joiner status assertions to match port [0-9]+ and :[0-9]+ rather than 7549.
  • 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.

Comment thread test/integration.sh
# 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)" ;;

Copilot AI Apr 26, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
*) fail ":port missing from join string (got: $join)" ;;
*) fail ":port missing from join string (got: ${join:0:40}...)" ;;

Copilot uses AI. Check for mistakes.
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.

2 participants