Repository navigation
fix(driver): wait for network and render quiet - #281
Merged
Merged
Conversation
Assisted-by: GPT-6
Assisted-by: GPT-6
Contributor
🐧 Performance briefing
Detailed measurementsPR performance comparisonBefore: 31cfed0 All measured attempts passed with zero engine-reported and observed LLM calls. Package size
Replay elapsed time
|
amazon7737
marked this pull request as ready for review
October 6, 2026 02:13
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.
A single pending fetch could reach network idle before its response, and deferred rendering could leave a skeleton in the next observation. Continuous polling could instead consume the entire timeout.
Chrome now requires a quiet interval across nonexcluded request identities/statuses and document mutations. Pending requests keep the wait active; a new response or render restarts the interval. The independent, expiring DOM observer preserves exact-reference guards. One deadline also bounds hung tool calls and the final sleep.
Consumers can configure
ChromeDriverOptions.settle.ignoreRequestswith URL substrings. Those defaults apply to engine and internal waits, with individual per-call overrides. Excluded requests remain cumulative evidence and still fail assertions; this does not changebenignor frozen scenarios.Closes #175.
Validation:
npm run test:settleuses committed local fixtures and public Driver/engine APIs. It checks a pending fetch followed by deferred rendering, polling exclusions with an unrecovered 503 still failing the built-in guard, continuous DOM mutation reaching its cap, and a server-verified commit with zero model calls.31cfed0, with a 400ms quiet interval: the original wait returned in 423ms while the fetch was pending; the fix waited 2764ms through completion and rendering. Excluded polling took 543ms instead of 2212ms. These are fixture observations, not general latency estimates.Settling remains best effort. Missing DOM measurements fall back to network waiting; numeric response status does not prove a streamed body finished. CSS-only changes, shadow/frame rendering, continuous DOM updates and work scheduled beyond the quiet window still require explicit
expect/waitForchecks. No hosted model was used.