Skip to content

test(relay): give the enrollment waits at least 3 s, not only 10,000 turns - #4078

Merged
devswha merged 1 commit into
mainfrom
fix/enrollment-wait-time-floor
Nov 17, 2026
Merged

devswha merged 1 commit into
mainfrom
fix/enrollment-wait-time-floor

Conversation

@devswha

@devswha devswha commented Nov 17, 2026

Copy link
Copy Markdown
Owner

What

src/lib/relay/shellEnrollment.test.tsx waits for the pairing flow with an until helper that gave up after 10,000 event-loop turns. Turns are not time: on a loaded runner the WebCrypto and fetch work behind a pairing can take longer than those turns spin. The Fast checks of #4074 failed that way on herdr-ci-ovis-parts-2 ("Enrollment did not reach the expected state", in "looks for the introduction as the pairing was made"); the rerun passed on another runner, and #4074 does not touch src/lib/relay/.

The helper now waits at least 3 s of real time as well as 10,000 turns, so it never gives up sooner than before. The clock is process.hrtime, which the tests' fake timers do not move; 3 s stays under Bun's 5 s test timeout.

Test-only: no app code changes.

Validation

  • bun run check fast: passed (18,593 unit tests, typecheck, build, generated themes and types).
  • bun test src/lib/relay/shellEnrollment.test.tsx: 44 pass.
  • Not reproduced locally before the fix: 24 copies at once, and 12 on one CPU core, all passed. The change only lengthens the wait, so it cannot fail a run the old helper passed.

🤖 Generated with Claude Code

…turns

shellEnrollment.test.tsx's `until` gave up after 10,000 event-loop
turns. Turns are not time: on a loaded runner the WebCrypto and fetch
work behind a pairing can take longer than those turns spin, and the
test failed with "Enrollment did not reach the expected state" (Fast
checks of #4074 on herdr-ci-ovis-parts-2; the rerun passed). The wait
now also lasts at least 3 s of real time (process.hrtime, which the
tests' fake timers do not move), under Bun's 5 s test timeout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Updated asynchronous test checks to keep waiting for expected conditions, within a maximum number of attempts and a time limit. The existing failure behavior remains unchanged when a condition is not reached. These changes affect test execution only; no end-user functionality or application behavior has changed.

The until helper now stops polling when its condition succeeds, or when both the 10,000-turn limit and three-second deadline have been reached.

Changes: Polling helper

Layer / File(s) Summary
Polling condition
src/lib/relay/shellEnrollment.test.tsx
The helper continues polling while fewer than 10,000 turns have elapsed or the three-second deadline has not passed. It retains the existing error when the condition is not reached.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Merge Risk: Minimal · up to c1836

This is a test-only change that makes the enrollment test helper more tolerant of slow CI runners. It does not affect application behavior, and no merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title says the enrollment waits gain a 3 s minimum alongside the 10,000-turn limit. The raw summary confirms the helper now keeps polling until the condition succeeds, 10,000 turns elapse, or a th…
Description check Passed The description states the problem (the 10,000-turn cap is too short on loaded runners), the resulting behavior (a 3 s real-time minimum via process.hrtime, under Bun's 5 s timeout), and scope (test-o…
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 says the enrollment waits gain a 3 s minimum alongside the 10,000-turn limit. The raw summary confirms the helper now keeps polling until the condition succeeds, 10,000 turns elapse, or a three-second deadline passes. The title names the main change and its scope, so it is accurate and specific.

Full details: Description check

Explanation

The description states the problem (the 10,000-turn cap is too short on loaded runners), the resulting behavior (a 3 s real-time minimum via process.hrtime, under Bun's 5 s timeout), and scope (test-only). It also lists validation runs and results. It omits a link to a maintainer-agreed issue, which the template asks for only with features, and it does not mention the changelog or contract-test coverage. Those gaps are non-critical for a test-only change, so the description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • 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 d1766a4 and c183649.

Files selected for processing: 1

  • src/lib/relay/shellEnrollment.test.tsx

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

@devswha
devswha merged commit 73176f4 into main Nov 17, 2026
16 checks passed
@devswha
devswha deleted the fix/enrollment-wait-time-floor branch November 17, 2026 21:02
devswha added a commit that referenced this pull request Nov 18, 2026
…y 2,000 digests (#4097)

## What

`src/lib/relay/shell.test.tsx` waits for signed pairing steps with
`untilSigned`, which gave up after 2,000 SHA-256 digests. Digests are
not time: on a loaded runner the WebCrypto work behind a signed pairing
can take longer than those turns. The Fast checks of #4085 failed that
way on `herdr-ci-ovis-parts-2` ("gave up waiting for …" at lines 571 and
778); #4085 does not touch `src/lib/relay/`.

Same fix as #4078 for `shellEnrollment.test.tsx`: the wait now also
lasts at least 3 s of real time (`process.hrtime`, which fake timers do
not move), so it never gives up sooner than before and stays under Bun's
5 s test timeout.

Test-only: no app code changes.

## Validation

- `bun run check fast`: passed (18,593 unit tests, typecheck, build,
generated themes and types).
- `bun test src/lib/relay/shell.test.tsx`: 35 pass.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

1 participant