Skip to content

relay: the dead-relay test fails fast on every machine, and the law leaves the behavioural file - #1394

Closed
AbirAbbas wants to merge 2 commits into
devfrom
fix/relay-dead-dial-in-laws
Closed

AbirAbbas wants to merge 2 commits into
devfrom
fix/relay-dead-dial-in-laws

Conversation

@AbirAbbas

Copy link
Copy Markdown
Collaborator

What

TestARelayThatIsNotThereIsItsOwnFact dials http://127.0.0.1:1 through Dial and through Register, each with the 20-second HandshakeWithin dialer timeout. On WSL2 with mirrored networking a closed loopback port hangs until that timeout instead of refusing (curl -m 25 http://127.0.0.1:1 times out there), so the test cost 40 seconds on a WSL2 laptop and 0.07 seconds on CI. It rode into every make test-laws (and so every make test-quick and make pr-ready) because it shares server_test.go with a go/parser law, and scripts/laws.sh runs every Test in a file that imports one.

  • The test now overrides a private dial-timeout seam (dialWithin, initialised from the unchanged HandshakeWithin) to 50ms and restores it with t.Cleanup. It still asserts errors.Is(err, ErrUnreachable) for both calls. No test in internal/relay runs in parallel.
  • The package's one law, TestTheRelayCannotEvenNameTheThingsItCarries, moves unchanged to server_law_test.go, so the laws run sweeps only the law and not its nine behavioural neighbours.

Measured on the WSL2 box

before after
internal/relay inside make test-laws 40.1s 0.03s
make test-laws wall 59-72s 23s
laws selected in total 621 tests 612 tests (125 files, 27 packages, unchanged)

Proof

  • Mutation: making upgrade's dial-error branch return a plain error turns the test red (dialling a relay that is not there gave mutated dial failure); reverted.
  • make pr-ready green on this branch (touched: ./internal/relay).

Part of the tui3/test-speed wave measured 2026-09-22: the other three changes shard the heavy suites, stop the tui3 harness from waiting out waiters that cannot answer, and make a large paste linear.

🤖 Generated with Claude Code

AbirAbbas and others added 2 commits September 23, 2026 09:52
…eaves the behavioural file

On WSL2 with mirrored networking a closed loopback port hangs until the dial
timeout instead of refusing, so TestARelayThatIsNotThereIsItsOwnFact paid two
20-second handshakes on the owner's box (40 of the 59 seconds of every
`make test-laws`) and 0.07 seconds on CI. The test now overrides a private
dial-timeout seam to 50ms and still proves ErrUnreachable, and the package's
one go/ast law moves to server_law_test.go so scripts/laws.sh no longer
sweeps nine behavioural neighbours into the gate.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@AbirAbbas

Copy link
Copy Markdown
Collaborator Author

Consolidated into #1419, which carries this change unchanged as its own commit alongside the rest of the test-speed wave.

@AbirAbbas AbirAbbas closed this Sep 23, 2026
@santoshkumarradha santoshkumarradha added the bug Something the code does that it should not label Oct 3, 2026
@santoshkumarradha santoshkumarradha added the area:remote --host, relay, pairing, enginehost, attachments label Oct 3, 2026
santoshkumarradha pushed a commit that referenced this pull request Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:remote --host, relay, pairing, enginehost, attachments bug Something the code does that it should not

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants