Skip to content

Let frames in flight finish before the nudge test jumps the clock - #370

Open
jedi4ever wants to merge 1 commit into
mainfrom
nudge-smoke-waits
Open

jedi4ever wants to merge 1 commit into
mainfrom
nudge-smoke-waits

Conversation

@jedi4ever

Copy link
Copy Markdown
Member

What changed

The nudge's smoke test (smoke/nudge.spec.ts) no longer fails at random.

Checks

  • On main as it is: 1 failure in 3 repeats of the test.
  • With this change: 36 of 36 pass (--repeat-each=12).
  • npm run check passes.

Not in this change

A square can't tell a clock that jumped from a frame that hung, which may also bite a real visitor whose laptop slept. Making the watchdog tell the two apart is a change to the sandbox's supervision and deserves its own decision.

🤖 Generated with Claude Code

The nudge's smoke test moves the page's clock on by a minute while inside
a booth. That clock is every square's too, so a square whose frame was
still being drawn when it jumped was stopped as hung, and the test failed
on the console errors: once in three runs locally, and three times in five
on pull requests since a heavier booth landed. The test now gives every
frame asked for before the jump its whole budget of real time first.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

@tessl-reviewer tessl-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tessl Reviewer

Advisory findings (1 advisory)

This repository runs Tessl Reviewer in advisory mode, so the review doesn't block merging.

The added delay gives entry-time work more time to settle, but it does not establish the safe clock-jump boundary described by the comment. Ongoing booth rendering leaves a reachable version of the existing smoke-test race.

Severity Should fix Advisory
Minor 0 1

Advisory (1)

  • Minor · Advisory · Pre-existing · The fixed delay leaves the clock-jump race active
    smoke/nudge.spec.ts:28

Reviews are incremental. The first review shows every valid finding. A later round checks the latest changes and earlier findings, and adds a fresh finding when it still applies. It never repeats one you refuted or declined. Ask for a full review to inspect the whole change and show earlier findings again.

Mention @tessl-reviewer to run another review.

Comment thread smoke/nudge.spec.ts
// The page's clock is every square's too, and a square stopped when its frame took over
// DRAW_BUDGET_MS can't tell a jump from a hang. So each frame asked for before the jump gets
// its whole budget of real time first: going inside is when the page is busiest.
await page.waitForTimeout(DRAW_BUDGET_MS + 250);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Advisory · Pre-existing · The fixed delay leaves the clock-jump race active

At smoke/nudge.spec.ts:25–29, waiting 1,250 ms does not give every pre-jump draw its full real-time budget. While inside the booth, map-frame.ts:48–51 continues scheduling draws, and sandbox-messages.ts:81–89 permits another request once the preceding reply has arrived. A request issued near the end of the delay can therefore still be pending when fastForward advances 65 seconds. Its active 1,000 ms watchdog in frame.ts:61–70 can stop a healthy worker before its reply is processed; the resulting console error is collected by watch() and fails the first test's problems assertion. This race was also possible before the change: the delay reduces entry-time contention but does not eliminate outstanding work as the new comment claims. A safe boundary must account for requests issued during the wait and their outstanding replies, rather than elapsed time alone.

Pre-existing: this is in code the change does not modify, so it is not blocking.

Craft · Maintainability And Code Quality · Markdown

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Preview: https://ainativedev.github.io/Carnival-Factory/previews/pr-370/ (built from 2148cbd). It updates on every push. Once this pull request closes, its links take you to the live map.

The map in this preview

This branch has not been deployed

No deployments
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