Skip to content
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

Merged
merged 1 commit into from
Feb 24, 2020
Merged

Conversation

d4vidi
Copy link
Collaborator

@d4vidi d4vidi commented Feb 23, 2020


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.

Detox = require('./Detox');
detox = new Detox({deviceConfig: validDeviceConfigWithSession});
await detox.init();
detox._client.getPendingCrashAndReset.mockReturnValueOnce('crash'); // TODO: rewrite to avoid accessing private fields
Copy link
Collaborator Author

@d4vidi d4vidi Feb 24, 2020

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));
Copy link
Collaborator Author

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?)

Copy link
Collaborator

@noomorph noomorph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yalla, davay.

@d4vidi d4vidi merged commit 6aa8181 into master Feb 24, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Feb 28, 2020
@LeoNatan LeoNatan deleted the anr-logging branch March 11, 2020 11:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Report thread-dump when ANR's are in effect
2 participants