You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Close Browser and Close All Browsers hide why closing a browser failed #5323
BrowserState.close() stops tracing, closes the contexts and the browser, and since #5318 runs the onClose of an adopted context. A failure in any of these steps ends up in one of these two catch blocks. For example, a trace file that cannot be written, or an onClose that throws when it releases a device connection, shows up as "was already closed" or not at all.
Expected behavior
The test does not fail, because closing mostly happens in teardown or automatic cleanup, and the browser is removed from the stack either way. But the log shows the real error, so that a failing trace save or onClose can be found.
Possible fix
Log the caught error in closeBrowser and closeAll, and keep "was already closed" only for the case where the browser really was closed already.
Found while reviewing #5318 (adoptContext, #5317).
Activity