Fix CDP monitor test navigation readiness - #391
Merged
Merged
Conversation
chruffins
approved these changes
Sep 14, 2026
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
Target.createTargetnavigation to commit to the expected stub URL before treating the page as readyRoot cause
Target.createTarget({url: stub.URL})can return while the new target still exposes its initialabout:blankdocument. Both tests considereddocument.readyState === "complete" && window.__kernelEventInjected === truesufficient, but the monitor can inject into that initial document before the requested navigation commits.On unmodified
origin/main(f33a66e), the exact CI command reproducedTestNetworkCaptureFromWorkerslocally. All worker cases executed against the opaque initial document:'/worker.js' is not a valid URL'null'navigator.serviceWorkerwas undefinedThe linked CI run also timed out at the identical predicate in
TestTelemetryConnectionOwnershipAndReconnect. Requiringlocation.href === stub.URL + "/"prevents the initial document from satisfying readiness and synchronizes both tests on the intended committed document.Failing run: https://github.com/kernel/kernel-images/actions/runs/34779734931/job/103785618145
Validation
From
server/:go testprocess each):2026-09-14T09:38:08Zthrough2026-09-14T09:41:12Z.go test -race ./lib/cdpmonitor ./lib/browsersurface ./lib/cdpclientgit diff --checkpassedChecklist