fix(browser): use monotonic capture timeout - #488
Open
AcidicSoil wants to merge 1 commit into
Open
Conversation
Contributor
🟠 Maintainer review suggested — low confidenceThe automated review could not reach a fully supported conclusion. Limitations
This review is advisory and does not block merging. |
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.
Summary
Use a monotonic clock for browser network-capture waits.
waitForCaptureJs()currently derives its deadline fromDate.now(). If the host wall clock jumps forward while the wait is active, the capture can time out before the requested elapsed duration has actually passed.performance.now()is monotonic and matches the semantics of an elapsed-time budget.Regression coverage
Adds a focused test that jumps
Date.now()forward by 60 seconds while a capture arrives normally. The test fails with the wall-clock deadline and passes with the monotonic deadline.Verification
npm run typecheck— passnpm run build— passnpx vitest run --project unit src/browser/dom-helpers.test.ts— 10/10 passgit diff --check— passThe aggregate unit suite also exposes unrelated timing/process flakes on this host; an unmodified
maincheckout reproduces the Electron launcher timeout. The changeddom-helperssurface remains green.