Repository navigation
test: scenario_bounce + scenario_two_tab_localhost - #111
Conversation
Two new integration scenarios catching real user-encountered bugs the existing tests missed: scenario_bounce — host → teardown → host. Verifies the teardown gist cleanup (#110) actually fires, AND that round-2 publishes a fresh gist without leaving an orphan from round 1. Catches the bounce-orphan class. Pre-#110: this would have failed with two competing gists. scenario_two_tab_localhost — A hosts, B joins via discovery, asserts B picked 127.0.0.1 (multi-address machine_id match) NOT the LAN or Tailscale IP. Catches multi-address regression. Pre-#109: this would have failed because B would have used whatever single address A advertised in the legacy host.address field. Both require gh + auth, skipped if unavailable. Both run quick (~10-15s each) since they use real gh round-trips but small data. Joel: "how are integration tests not actually able to test my scenario?" — they couldn't, because the existing scenarios all use --no-gist (sidesteps the actual gh substrate code path) and only spawn one joiner (no concurrent / lifecycle coverage). These two scenarios use the real gh path and exercise the lifecycle edges. Windows parity: still NONE. test/integration.sh is bash-only. A matching test/integration.ps1 with PS-native commands is needed for Windows users to verify their install. Tracked but not in this PR. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
Adds two new end-to-end integration scenarios to test/integration.sh to cover recent real-user regressions around (1) gist orphan accumulation after bounce/teardown and (2) same-machine multi-address selection preferring localhost.
Changes:
- Add
scenario_bounceto verifyairc teardowndeletes the hosted room gist (no orphan buildup across host restarts). - Add
scenario_two_tab_localhostto verify gist envelope propagation (host.machine_id,host.addresses[]) and that joiners pick127.0.0.1on same-machine joins. - Wire both scenarios into the mode dispatcher and include them in the
allrun.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| scenario_bounce() { | ||
| section "bounce: teardown deletes hosted gist (no orphan accumulation)" | ||
|
|
||
| if ! command -v gh >/dev/null 2>&1 || ! gh auth status >/dev/null 2>&1; then |
There was a problem hiding this comment.
The skip guard combines command -v gh and gh auth status but the message only says "gh not authed". If gh isn’t installed, this will report the wrong reason; consider splitting the checks (like scenario_heartbeat) so the skip output is accurate and actionable.
| if ! command -v gh >/dev/null 2>&1 || ! gh auth status >/dev/null 2>&1; then | |
| if ! command -v gh >/dev/null 2>&1; then | |
| echo " (skipped — gh not installed)" | |
| return | |
| fi | |
| if ! gh auth status >/dev/null 2>&1; then |
| if ! command -v gh >/dev/null 2>&1 || ! gh auth status >/dev/null 2>&1; then | ||
| echo " (skipped — gh not authed)" | ||
| return | ||
| fi |
There was a problem hiding this comment.
scenario_two_tab_localhost uses jq to parse the gist envelope, but it doesn’t skip when jq isn’t installed. On machines without jq, this scenario will fail instead of skipping; add a command -v jq guard (and ideally distinguish between "gh missing" vs "gh not authed" in the skip message as well).
| if ! command -v gh >/dev/null 2>&1 || ! gh auth status >/dev/null 2>&1; then | |
| echo " (skipped — gh not authed)" | |
| return | |
| fi | |
| if ! command -v gh >/dev/null 2>&1; then | |
| echo " (skipped — gh not installed)" | |
| return | |
| fi | |
| if ! gh auth status >/dev/null 2>&1; then | |
| echo " (skipped — gh not authed)" | |
| return | |
| fi | |
| if ! command -v jq >/dev/null 2>&1; then | |
| echo " (skipped — jq not installed)" | |
| return | |
| fi |
| for f in /tmp/airc-it-h/state/airc.pid /tmp/airc-it-j/state/airc.pid; do | ||
| [ -f "$f" ] && kill -9 $(cat "$f") 2>/dev/null | ||
| done |
There was a problem hiding this comment.
The cleanup loop kills only the PID(s) in the pidfile and doesn’t remove the pidfile or kill child processes (contrast with cleanup_procs, which also kills children via pgrep -P and rm -f’s the pidfile). This can leave orphaned subprocesses (e.g., ssh) and makes later cleanup less safe; consider reusing cleanup_procs here instead of duplicating a weaker kill path.
| for f in /tmp/airc-it-h/state/airc.pid /tmp/airc-it-j/state/airc.pid; do | |
| [ -f "$f" ] && kill -9 $(cat "$f") 2>/dev/null | |
| done | |
| cleanup_procs |
Two scenarios covering the real-user bugs from today: bounce-orphan accumulation (caught by #110) and multi-address localhost selection (caught by #109). Both use real gh; both pass on this Mac.