Fix flaky verifyOnAppComesFromBackgroundCalled test#17370
Merged
Conversation
Contributor
|
|||||||||||
| 💡 Scan this QR code with your Android phone to download and install the APK directly on it. | ||
| App | Jetpack | |
| Build Flavor | Jalapeno | |
| Build Type | Debug | |
| Commit | 81120a0 | |
Contributor
|
|||||||||||
| 💡 Scan this QR code with your Android phone to download and install the APK directly on it. | ||
| App | WordPress | |
| Build Flavor | Jalapeno | |
| Build Type | Debug | |
| Commit | 81120a0 | |
pachlava
approved these changes
Oct 26, 2022
Contributor
pachlava
left a comment
There was a problem hiding this comment.
Thanks a lot for working on this @irfano 👋
I can see that Instrumented Tests are green on FTL, and I think it's enough to have the change merged. Because the test rarely fails, the best way is to let the change into the wild and see how it behaves in the long run 👍 🚀
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This increases sleep time in
verifyOnAppComesFromBackgroundCalledtest case.verifyOnAppComesFromBackgroundCalledfails rarely on Firebase Test Lab environment.I ran the application multiple times on emulator and debugged the order of related functions. It's like this:
onCreateruns,AppInitializer's onAppComesFromBackground runs,WordPress.appIsInTheBackgroundis set to false.But in FTL environment, step 4 works before 2 sometimes. That causes the test to fail. We don't use
WordPress.appIsInTheBackgroundfor instant checks after app launch, so it's totally safe to increase sleep time forverifyOnAppComesFromBackgroundCalled. The time was set to 200, but it can be increased if it still fails.To test:
Run
verifyOnAppComesFromBackgroundCalledtest case on FTL a couple times.Regression Notes
Potential unintended areas of impact
None
What I did to test those areas of impact (or what existing automated tests I relied on)
N/A
What automated tests I added (or what prevented me from doing so)
Updated current test.
PR submission checklist:
RELEASE-NOTES.txtif necessary.