Repository navigation
test(engine): drive the empty-screenshot probe test with fake timers - #7000
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.tsat 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 withexpected 'beginFrame probe timeout before warm-…'. Making each CDPsendtake 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 instudio-serverprojectHistory.test.ts > never removes a lock another process holds(HistoryBusyErrorat the lock deadline). That is unrelated to this one-file engine test change. The Windows shards were still running when I reviewed.
miguel-heygen
force-pushed
the
fix/beginframe-probe-test-clock
branch
from
November 9, 2026 16:02
bf74cbb to
0111704
Compare
miguel-heygen
enabled auto-merge
November 9, 2026 16:19
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>
3 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
BeginFrame capability probe > reports an empty screenshot as unsupportedtest 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 readbeginFrame probe timeout before ...instead ofreturned 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 withexpected '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.