Skip to content

test(engine): drive the empty-screenshot probe test with fake timers - #7000

Merged
miguel-heygen merged 1 commit into
mainfrom
fix/beginframe-probe-test-clock
Nov 9, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
fix/beginframe-probe-test-clock

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

The BeginFrame capability probe > reports an empty screenshot as unsupported test ran the probe against a real 120 ms deadline. On a slow runner (windows-latest) the deadline passed before the loop reached its last attempt, so the message read beginFrame probe timeout before ... instead of returned 0 bytes after N attempts.

The test now runs under fake timers and advances time itself, so the outcome no longer depends on how fast the machine is. No source change.

fails without the fix: BeginFrame capability probe > reports an empty screenshot as unsupported (the old version, run with every clock read made 25 ms slower, fails with expected 'beginFrame probe timeout before warm-…' to match /returned 0 bytes after \d+ attempts/; the new version passes under the same slow clock)

The file passes 3 runs in a row (117 tests), oxfmt clean.

Size

One test, 11 lines added.

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: APPROVE · 0 blocker · 0 important · 0 nits · head bf74cbbb

Test-only. Vitest 4 fake timers also fake Date, which is the clock the probe uses for its deadline. Each 10 ms retry delay is advanced on purpose, so the loop always stops at Date.now() + 10 >= deadline and throws the 0 bytes after N attempts error, however slow the machine is. try/finally puts real timers back.

Checks
  • Ran browserManager.test.ts at head 3 times: 117/117 passed each run.
  • The 'fails without the fix' claim holds. With the old test body and each Date.now() read made 25 ms slower, the test fails with expected 'beginFrame probe timeout before warm-…'. Making each CDP send take 40 ms of real time also breaks the old body (…timeout before scree…). The new body passes under the same 40 ms slow-down.
  • CI: the one red check, Test (support), fails in studio-server projectHistory.test.ts > never removes a lock another process holds (HistoryBusyError at the lock deadline). That is unrelated to this one-file engine test change. The Windows shards were still running when I reviewed.

@miguel-heygen
miguel-heygen force-pushed the fix/beginframe-probe-test-clock branch from bf74cbb to 0111704 Compare November 9, 2026 16:02
@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit c9fe041 Nov 9, 2026
77 checks passed
@miguel-heygen
miguel-heygen deleted the fix/beginframe-probe-test-clock branch November 9, 2026 16:48
SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Nov 9, 2026
…(upstream heygen-com#7000)

The probe test waited out its real 120 ms deadline. It now runs under fake
timers and advances them, so the result no longer depends on how loaded the
machine is.

Ported from heygen-com/hyperframes c9fe041; the patch applied cleanly.
Test-only change, so there is no red phase; browserManager.test.ts passes.

Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com>
Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Nov 9, 2026
…n-com#7110, heygen-com#7000; advance watermark

Eight commits, PR heygen-com#7452 and ten pin moves are recorded with their evidence
in the continued ledger, DECISIONS and UPSTREAM. Adopted: heygen-com#7249 (template
entries detected structurally), heygen-com#7110 (whisper nan/inf output), heygen-com#7000
(engine probe test on fake timers). Deferred: heygen-com#7444, heygen-com#7452. Not applicable:
heygen-com#7257, heygen-com#7443, heygen-com#7450. The watermark moves to c149730, PR heygen-com#7452, and the
nine moved pins plus heygen-com#7434 are re-pinned at their current heads.

Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
@miguel-heygen miguel-heygen mentioned this pull request Nov 9, 2026
3 of 4 tasks
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