clients(lr): modify puppeteer connector to work with new tab targets #15674
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.
b/314831962
https://github.com/puppeteer/puppeteer/releases/tag/puppeteer-core-v21.4.0 modified how Puppeteer does target discovery, excluding the page targets and connecting to tab targets instead.
Our LR glue code to get a Puppeteer page was stalling at Puppeteer's CdpBrowser.create, in a "wait for initial targets" phase, since our target filter ended up excluding every target. Previously, it would correctly filter to just the "main" target, but that no longer happens (
mainTargetInfo
no longer matches any target id we see).Instead, allow the Puppeteer connection to connect to all target types. With this change, LR now works w/ this Puppeteer version, and Smokerider is all green.
Additionally, it was pointed out that the relevant tab target / puppeteer Page may not exist by the time we are checking for it, so I modified the function to check multiple times (but w/ a 5s timeout).