| Summary: | Web Inspector: `inspector/debugger/breakpoints/resolved-dump-all-pause-locations.html` is a flakey failure | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Patrick Angle <pangle> | ||||
| Component: | Web Inspector | Assignee: | Patrick Angle <pangle> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | ews-watchlist, hi, inspector-bugzilla-changes, joepeck, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=235607 | ||||||
| Attachments: |
|
||||||
|
Description
Patrick Angle
2022-04-12 11:29:43 PDT
Created attachment 457349 [details]
Patch v1.0
Comment on attachment 457349 [details]
Patch v1.0
Oo, neat!
Comment on attachment 457349 [details] Patch v1.0 View in context: https://bugs.webkit.org/attachment.cgi?id=457349&action=review r=me > Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:247 > + async awaitPendingDispatches() Rather than have a new method, could we make `runAfterPendingDispatches` just return a `Promise` if a `callback` is not provided (i.e. just like what we do with protocol commands in the frontend)? > LayoutTests/inspector/debugger/breakpoints/resources/dump.js:10 > + window.addDumpAllPauseLocationsTestCase = async function(suite, {name, scriptRegex, resourceRegex}) { Why does this need to be `async`? > LayoutTests/inspector/debugger/breakpoints/resources/dump.js:27 > + await InspectorBackend.awaitPendingDispatches(); Another option to waiting for pending dispatches could be to do something like `WI.networkManager.mainFrame.resourceCollection.addEventListener(WI.Collection.Event.ItemAdded, (event) => { ... })`. I feel like that's probably safer than just waiting for pending dispatches as I'm not sure it's guaranteed that the script message is pending (i.e. it could be coming *right* after the current messages). > LayoutTests/inspector/debugger/breakpoints/resources/dump.js:51 > + await InspectorBackend.awaitPendingDispatches(); possibly a ditto of :27 by waiting for `Debugger.breakpointResolved` instead? Comment on attachment 457349 [details] Patch v1.0 View in context: https://bugs.webkit.org/attachment.cgi?id=457349&action=review >> LayoutTests/inspector/debugger/breakpoints/resources/dump.js:10 >> + window.addDumpAllPauseLocationsTestCase = async function(suite, {name, scriptRegex, resourceRegex}) { > > Why does this need to be `async`? Oops. Remnant of solutions past. >> LayoutTests/inspector/debugger/breakpoints/resources/dump.js:27 >> + await InspectorBackend.awaitPendingDispatches(); > > Another option to waiting for pending dispatches could be to do something like `WI.networkManager.mainFrame.resourceCollection.addEventListener(WI.Collection.Event.ItemAdded, (event) => { ... })`. I feel like that's probably safer than just waiting for pending dispatches as I'm not sure it's guaranteed that the script message is pending (i.e. it could be coming *right* after the current messages). Yeah, let me take another look at this... You are probably right. Comment on attachment 457349 [details] Patch v1.0 View in context: https://bugs.webkit.org/attachment.cgi?id=457349&action=review Not sure why, but the bug is now reproducing after I pulled this patch back to my machine, so I'm not convinced I've actually/fully fixed this. >>> LayoutTests/inspector/debugger/breakpoints/resources/dump.js:10 >>> + window.addDumpAllPauseLocationsTestCase = async function(suite, {name, scriptRegex, resourceRegex}) { >> >> Why does this need to be `async`? > > Oops. Remnant of solutions past. Oops. Remnant of solutions past. >>> LayoutTests/inspector/debugger/breakpoints/resources/dump.js:27 >>> + await InspectorBackend.awaitPendingDispatches(); >> >> Another option to waiting for pending dispatches could be to do something like `WI.networkManager.mainFrame.resourceCollection.addEventListener(WI.Collection.Event.ItemAdded, (event) => { ... })`. I feel like that's probably safer than just waiting for pending dispatches as I'm not sure it's guaranteed that the script message is pending (i.e. it could be coming *right* after the current messages). > > Yeah, let me take another look at this... You are probably right. Yeah, let me take another look at this... You are probably right. Pull request: https://github.com/WebKit/WebKit/pull/1066 Committed r294907 (251030@main): <https://commits.webkit.org/251030@main> Reviewed commits have been landed. Closing PR #1066 and removing active labels. |