Skip to content

test(relay): fix the three races behind relay-offline-reasons-regression's flakes - #4313

Merged
devswha merged 2 commits into
mainfrom
fix/relay-offline-reasons-flake
Nov 20, 2026
Merged

devswha merged 2 commits into
mainfrom
fix/relay-offline-reasons-flake

Conversation

@devswha

@devswha devswha commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

What

scripts/relay-offline-reasons-regression.ts failed now and then in CI browser lane 2/3 and passed on rerun (seen on #4300 and #4303). This fixes the two races behind it, in the script only. No sleeps, no longer timeouts.

  1. socket hang up, then a 20 s reload timeout (CI job 136078025377). The app.ovis.sh route answered each request with route.fetch to a local Bun.serve of dist-shell/. That fetch threw socket hang up (line 181), so the route was never fulfilled and the walk's reload waited out its 20 s. The shell is now answered in the script's own process with pagesResponse from scripts/pages-static.ts (as relay-media-browser-qa.ts already does), so no socket can hang up.

  2. "precondition: both rows: evaluate: Execution context was destroyed" (seen 4 times while proving 1). toPcs set location.hash with page.evaluate and then reloaded, on a page the sign-in's return could still be navigating. It now always loads the PCs view with a navigation of its own (goto /?pcs, which boot.ts moves into #pcs), which supersedes any navigation still in flight. seed also waits for the stored session as well as the key, since only the session marks the end of the sign-in's navigations.

  3. "stopped pc-a: its check: found it 'checking'" (seen once while proving 1 and 2). The glyph was read right after a check settled, and the list's sweep can begin another check of that PC in between. The glyph is now read once no check of it runs.

The in-process answer also follows the shell's own same-origin redirects (/s/<id> to /s/<id>/), as route.fetch did, so a redirect never leaves the route for the real host (gate review). A missing file's 404 no longer carries content-type: text/plain; its body and headers are otherwise the same, and the walk loads no missing file.

I could not catch the stray navigation in a log (instrumented runs passed 32/32), so part 2 removes the fragile step rather than naming that navigation.

Validation

  • 20/20 passes of this script in the CI runner image on hosthatch (ovis-in-image, ci-browser-parallel.ts, BROWSER_RETRY=0, 6 workers), with bun run typecheck first. Before part 2 the same loop failed 3 times in 15 runs; before part 3, once in 19.
  • bun run check fast on hosthatch: exit 0.
  • Not run: the full browser suite (this PR changes one script and nothing it imports).

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Updated the offline relay regression checks to cover navigation to the PCs view, account setup, and PC status display. The checks now wait for required setup and status operations to finish before verifying results.

The regression script now serves routed page requests through an in-process Pages shell. It updates pairing readiness, PCs navigation, and status-check polling.

Changes: Offline-Reasons Regression Script

Layer / File(s) Summary
In-process Pages shell and navigation
scripts/relay-offline-reasons-regression.ts
The script loads the Pages shell and fulfills routed requests through pagesResponse. The PCs view now loads through /?pcs and checks for the #pcs fragment.
Pairing and details-check polling
scripts/relay-offline-reasons-regression.ts
Pairing readiness now requires both the stored key and session. The details-status check waits for the glyph to leave checking before reading its state.

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

Change: Other

Merge Risk: Minimal · up to 128c7

This change only makes a regression test script more reliable and does not affect production behavior. No concrete problems were found, so it is ready to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the test script and the race-condition fix, which matches the changeset. It is specific and accurate. The title is 81 characters, which is a little long but still a single clear senten…
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.
Description check Passed The description follows the template's two sections. The Change section states the problem (CI flakes in relay-offline-reasons-regression on lane 2/3, seen on #4300 and #4303), lists three races with …
Full details: Title check

Explanation

The title names the test script and the race-condition fix, which matches the changeset. It is specific and accurate. The title is 81 characters, which is a little long but still a single clear sentence.

Full details: Description check

Explanation

The description follows the template's two sections. The Change section states the problem (CI flakes in relay-offline-reasons-regression on lane 2/3, seen on #4300 and #4303), lists three races with their fixes, and names the script as the only change. The Validation section lists the commands run (typecheck, check fast, a 20/20 loop on the CI runner image) and the skipped full browser suite. The template asks for a linked issue for features, but this is a test-script bugfix, so that does not apply. The description is complete and specific.

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 7b7c82f and 128c71f.

Files selected for processing: 1

  • scripts/relay-offline-reasons-regression.ts

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

@devswha
devswha force-pushed the fix/relay-offline-reasons-flake branch from c6e9e5b to 128c71f Compare November 20, 2026 08:10
@devswha
devswha merged commit 9fc130f into main Nov 20, 2026
16 checks passed
@devswha

devswha commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

Merged through pr-merge at head ca6b8a04c. Seen before the merge was asked for: required checks green, no unresolved thread, no conflict, no hold, main not red, no release in progress. CodeRabbit finished, with no review that names this head.

CodeRabbit did not review this head. Reviews of record at head ca6b8a0: omo review (dori review) CLEAR, and the omo gate reviewer (gpt-6.2-astra) CLEAR after its MEDIUM (a shell redirect escaping the route) was fixed and its 418-origin reproduction rerun; its LOW (a missing file's 404 without content-type) is left and noted in the PR body. Proof: 20/20 in the CI runner image on hosthatch with typecheck first; bun run check fast exit 0. Merged by lane flaky-relay-offline on the lead's merge override.

@devswha
devswha deleted the fix/relay-offline-reasons-flake branch November 20, 2026 08:50
@devswha devswha mentioned this pull request Nov 20, 2026
devswha added a commit that referenced this pull request Nov 20, 2026
Release 0.5.7, on the owner's word (2026-11-20: "릴리즈하고 배포까지해봐").

- `package.json` and `herdr-plugin.toml`: 0.5.6 -> 0.5.7.
- `REMOTE_BUNDLE_VERSION` 50 -> 51 (`shared/machines.ts`): `server/` and
`shared/` changed since `remote-v50`, so the remote bundle's inputs
differ. After this merges, `remote-v51` is tagged on the merge commit
and the Remote PC bundles run publishes it before the Release run. Until
the Release run is done, nothing touching `server/`, `shared/`,
`bun.lock` or `patches/` merges.
- `CHANGELOG.md`: no fragments had been added since 0.5.6, so this PR
writes one and folds it under 0.5.7 (dated 2026-11-21) with `bun
scripts/changelog-fold.ts 0.5.7`: a Maintenance section for the step-2
account groundwork (#4278 to #4327, all behind `OVIS_ACCOUNT_OPENS_ALL`,
off by default) and the two browser-regression flake fixes (#4313,
#4317). PR links written by hand (the fold found no merged PR for a
fragment added in this PR). No `by @login` credits: all 22 PRs are by
the maintainer.
- `release-summaries.json`: 0.5.7 has one `improved` line in en, ko, ja
and zh. What users see is small because step 2 is off by default: the
line says so ("Groundwork for account device safety, switched off:
nothing changes.").
- `telemetry/deployed.json` unchanged: no Worker source changed since
0.5.6 (release guards agree).

## Validation
- `bun run check fast` on the remote heavy host at 8dab46d (on main
bd9f574): every step ok, unit 20809 pass, 0 fail.
- `bun test scripts/changelog-fold.test.ts scripts/release-notes.test.ts
server/release-notes.test.ts scripts/release-guards.test.ts`: 60 pass, 0
fail.
- `bun scripts/release-guards.ts --base origin/main`: "Release 0.5.7:
remote bundle, telemetry Worker and release metadata are in order."
- `bun scripts/release-notes.ts 0.5.7` renders the notes.
- Not run: `check full` (the diff is versions, notes and one constant).
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