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

Prevent Monkey #2054

Closed
David-Lannion opened this issue Jan 8, 2021 · 3 comments · Fixed by #2104
Closed

Prevent Monkey #2054

David-Lannion opened this issue Jan 8, 2021 · 3 comments · Fixed by #2104
Milestone

Comments

@David-Lannion
Copy link

Problem description

I use monkey tests to find leaks but the monkey is deleting the leaks :/

Potential solutions

From https://stackoverflow.com/questions/10285067/how-to-filter-specific-activities-to-be-tested-by-monkey-using-android-intent-ca
Add a test : if (ActivityManager.isUserAMonkey()) {finish();}

Additional information

@pyricau
Copy link
Member

pyricau commented Jan 19, 2021

The thing is, others have used a monkey to find bugs in the activity that displays leaks, so I'd rather not do that :) .

However, when running the monkey, you could:

@David-Lannion
Copy link
Author

Ok but at least protect the delete/DeleteAll button maybe?

@pyricau
Copy link
Member

pyricau commented Jan 21, 2021

That would defeat the point.

That being said, I'm curious: if we implement the solution you proposed to finish the activity immediately when the user is a monkey, how do you intend to use the monkey to report / detect leaks? Did you intend to manually go into the activity after running the monkey?

pyricau added a commit that referenced this issue Mar 26, 2021
@pyricau pyricau added this to the 2.7 milestone Mar 26, 2021
ghost pushed a commit to shivagowda/leakcanary that referenced this issue Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants