-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(Android) Introduce ANR monitor to produce warn-logs #1926
Conversation
a83af02
to
32f994d
Compare
Detox = require('./Detox'); | ||
detox = new Detox({deviceConfig: validDeviceConfigWithSession}); | ||
await detox.init(); | ||
detox._client.getPendingCrashAndReset.mockReturnValueOnce('crash'); // TODO: rewrite to avoid accessing private fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO ➡️ done ✅
@@ -57,6 +57,7 @@ class Detox { | |||
} | |||
|
|||
this._client = new Client(sessionConfig); | |||
this._client.setNonresponsivenessListener(this._onNonresnponsivenessEvent.bind(this)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@noomorph I was far from sure as to whether this is the right level for this work-scope. I'd be happy to get your insights on this (for example, should this be part of the client's implementation?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yalla, davay.
Description:
Resolves #1925. Introduces usage of the very interesting ANR-WatchDog project for the sake of ANR-state proximation. The ends result is a warning on the Detox (tester) side with a main-thread stacktrace, when main-thread blockage is detected, alongside a complete thread-dump on the device logs.
Integration of it all was pretty straightforward, but testing this (e2e) was a bit of a pain since logs are not easy to intercept.