-
Notifications
You must be signed in to change notification settings - Fork 132
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
Fix the Instrumented Tests for once and for all? #327
Merged
Merged
Conversation
This file contains 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
igorescodro
changed the title
Fix/tests
Fix the Instrumented Tests for once and for all?
Sep 20, 2022
igorescodro
force-pushed
the
fix/tests
branch
7 times, most recently
from
September 27, 2022 19:27
d99aab0
to
d9bcb01
Compare
igorescodro
force-pushed
the
fix/tests
branch
8 times, most recently
from
October 3, 2022 12:57
c3e50f1
to
38f4d87
Compare
igorescodro
force-pushed
the
fix/tests
branch
3 times, most recently
from
October 7, 2022 19:10
28e6536
to
445a606
Compare
The problem was not related to the Android Gradle Managed Devices after all. It seems that my new `FlakyTest()` (which was created because some Compose tests were flaky on CI) made the tests EVEN FLAKIER. That's ironic. Or not, because the name says that they are flaky... Anyway, reverting it back.
Okay, that's a tentative. But seems that the tests are crashing because the test scenario was stuck during some tests. The idea is to make all the rules run in a specific order and use the ActivityScenarioRule to rely on the library implementation and avoid boilerplate.
They were very annoying...
The CI were not happy with some of the changes...
This reverts commit 4b9454f
Remove the `runBlocking` in favor of `runTest` which is more appropriate for testing.
Removing all the `Thread.sleep()` in favor of Compose "waitUntil()" for better handling idling resources. The solution here is based on the excellent article from Jose Alcérreca. https://medium.com/androiddevelopers/alternatives-to-idling-resources-in-compose-tests-8ae71f9fc473
Adding more `waitUntil` and hoping for the best
Hopefully adding this will make the test stop failing with `keyDispatchingTimedOut`?
Let's work on test at the time until it's consistent.
This reverts commit 076338f.
This is a never ending task, right?
The Database Migration test class were using deprecated API and the dependency for AndroidJUnit4 was missing due to wrong Gradle configuration.
Slow and steady!
Let's try this based on random comments in different issues
igorescodro
force-pushed
the
fix/tests
branch
2 times, most recently
from
October 12, 2022 19:35
8f63a98
to
7ae8da3
Compare
It seems that this problem is happening EVERYWHERE. So I'll copy the Accompanist setup and add more emulator. I'll start assuming that, if one emulator pass all the tests, then we are good to go.
Dependency re-added as a `implementation` rather than a `androidTestImplementation`.
This test is redundant with the flow one in :app and also seems to vary based on SDK. Setting it on fire for now.
Not only :app, please.
igorescodro
force-pushed
the
fix/tests
branch
from
October 12, 2022 19:45
7ae8da3
to
e275667
Compare
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.
The problem was not related to the Android Gradle Managed Devices after all. It seems that my new
FlakyTest()
(which was created because some Compose tests were flaky on CI) made the tests EVEN FLAKIER. That's ironic. Or not, because the name says that they are flaky... Anyway, reverting it back.In the end, I decided to add more emulators and if at least one passes all the tests, it’s good to go. That’s the solution for now, otherwise I’ll never merge code anymore.