Open perezju opened 7 years ago
The work to add retries for opening the browser is only applied to desktop browser (desktop_browser_finder in https://codereview.chromium.org/2868703002/). We need to look at the log to see when it's taken.
After digging through the log and reconstructing the execution flow, this appears to be happening:
I'll note that the desktop_browser_backend is affected by a similar thing (but not the cros_browser_backend).
I can think of two alternatives:
Grab the screenshot when raising the AppCrashException
(or the more generic Telemetry Error).
Pros: This sounds like a good place (in general) for trying to grab as much information as possible about the environment where the error occurred.
Cons: We don't get screenshots for non-Telemetry Errors. (And may be awkward to get hold of the platform
object at that point to grab the screenshot.)
Do not close the browser upon failures in *_browser_backend.Start
Pros: It's probably cleaner. Also the current implementation (in both android/desktop) is somewhat inconsistent. There is significant code between "opening the browser" and "waiting for it" which is not in the try/except block, and which will not cause the browser to be closed upon failure.
Cons: Feels a bit icky for the *_browser_backend
object to not clean up after itself in case of failures?
How about do screen shot at both when AppCrash & in state.DumpStateUponFailure ? In some sense, I am seeing this paradigm is similar to: you take browser log & platform log when thing goes wrong.
On system_health.common_mobile at android nexus-5x, some stories fail with the following dump UI:
(full log)
But the corresponding screenshot only shows the launcher after the browser has been closed.
@nedn maybe the recent work to add retries for opening the browser is causing screenshots to be taken after it has been closed?