Skip to content

test: stabilize Link preflight and standalone stop checks - #9064

Merged
lidge-jun merged 4 commits into
lidge-jun:devfrom
luvs01:codex/link-stop-timing-tests
Nov 25, 2026
Merged

lidge-jun merged 4 commits into
lidge-jun:devfrom
luvs01:codex/link-stop-timing-tests

Conversation

@luvs01

@luvs01 luvs01 commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Two tests failed on the Ubuntu changed-test run for #9061.

  • The Link test keeps a real loopback peer. Once the peer receives the complete credential-free probe, the test advances its clock to the original 20 ms deadline. It still checks that the operation fails with the expected timeout, sends no credentials, and leaves the request body untouched. A real abort cleans up if the probe never arrives.
  • The stop test runs each matching or mismatching standalone record in its own temporary home. Each case has the standard five-second test timeout. Previously three separate CLI invocations shared one five-second limit. The real CLI arguments, platform-specific coverage and total number of child invocations are preserved.

Verification

  • Reproduced the original Link failure by delaying delivery to the test peer for 90 ms. The revised test passed under the same delay. When the probe was withheld, it failed as expected and the process exited.
  • On Windows x64 with Bun 1.4.4, the Link test file passed all 17 cases (94 assertions). On the combined commit, the two affected files with a name filter selecting the changed cases passed 6 cases with 58 assertions. One POSIX-only case was skipped.
  • bun check --no-script --noEmit, bun scripts/structure-ssot.ts and git diff --check passed. Local testing focused on the changed fixtures. The Ubuntu CI run covers the POSIX-only input.

Checklist

  • Only changed the two tests that failed in the linked run.
  • Checked that the changes affect test setup and scheduling only.
  • Preserved the assertions about stop authorization, signals, credentials, and request bodies.

Summary by CodeRabbit

  • Tests
    • Improved coverage for authentication timeouts, confirming a silent peer triggers the expected timeout even when the request has a longer abort window, and that the request body remains unread and uncancelled.
    • Expanded stop-operation checks for matching and mismatched records. Tests confirm valid legacy and current records permit ordinary stops after discovery misses, while wrong-home, wrong-port, stale, and client-role records prevent stop requests and signals.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The changes update two test areas. The relay test controls when its authentication timeout expires. The deferred-teardown tests separate matching-record stop cases from mismatch cases and add assertions about receipts, signals, stop URLs, and nonces.

Changes: Relay authentication timeout test

Layer / File(s) Summary
Control the silent-peer timeout
tests/clients/link-relay-bound-transport.test.ts
The test names the 20 ms timeout and advances the fake timer after the peer receives the authentication probe. It supplies a 2-second abort signal and restores real timers in a finally block. Existing assertions continue to check that the request body is neither read nor cancelled.

Deferred teardown stop tests

Layer / File(s) Summary
Check matching and mismatched records
tests/service/stop-deferred-teardown.test.ts
Separate tests verify that legacy and current records permit an ordinary stop after a discovery miss, including the absence of a receipt. Wrong-home, wrong-port, stale, and client-role records refuse the stop; the tests also check that no signal, stop URL, or nonce is issued. The wrong-home case remains skipped on Windows.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Possibly related PRs

  • lidge-jun/opencodex#8834: Updates fixtures in the same test file to address the 20 ms authentication window expiring before the data request starts.
Merge Risk: Minimal · up to 68730

This change only stabilizes two tests and does not alter production behavior. No actionable merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "test: stabilize Link preflight and standalone stop checks" matches the PR objectives. The PR changes two test files: the Link relay-bound transport test now advances the 20 ms fake-timer de…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "test: stabilize Link preflight and standalone stop checks" matches the PR objectives. The PR changes two test files: the Link relay-bound transport test now advances the 20 ms fake-timer deadline only after the peer receives the probe, and the standalone stop test runs each record in its own temporary home. The title names both affected areas and uses the conventional test: prefix. It is specific and does not describe anything outside the changeset.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 7cec010 and 68730c7.

Files selected for processing: 1

  • tests/clients/link-relay-bound-transport.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Nov 23, 2026
@luvs01
luvs01 marked this pull request as ready for review November 23, 2026 01:56
@lidge-jun

Copy link
Copy Markdown
Owner

Maintainer integration (lane W, @lidge-jun) at exact head 68730c72c7112c42557709c953621f81b9f925d9, which contains dev 49554a1221.

  • Added 68730c72c7: the missing-probe watchdog now aborts after 2 s, inside the 5 s test timeout, so finally always restores real timers (independent review finding).
  • PR CI on this head: gates, test changed, ci, hygiene, enforce-target, CodeRabbit all pass.
  • Real Windows x64 (Bun 1.4.4), PR head merged with dev: both changed files 163 pass / 10 skip / 0 fail.
  • macOS: bun run typecheck clean; bun run test:changed 173 pass / 0 fail; both files 173 pass.
  • Independent gpt-6.1-terra review, two rounds: PASS, no open findings.
  • scripts/ci/assert-mergeable-review.sh --maintainer-integration 9064: OK.

@lidge-jun
lidge-jun merged commit 9c3ddc4 into lidge-jun:dev Nov 25, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants