-
Notifications
You must be signed in to change notification settings - Fork 625
dataconnect: fix two flaky tests due to their failure to wait for FirebaseAuth to be initialized #6835
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
dataconnect: fix two flaky tests due to their failure to wait for FirebaseAuth to be initialized #6835
Conversation
…ebaseDataConnect instance in queryShouldRetryOnUnauthenticated and mutationShouldRetryOnUnauthenticated
📝 PRs merging into main branchOur main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released. |
1 similar comment
📝 PRs merging into main branchOur main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released. |
Coverage Report 1Affected Products
Test Logs |
Test Results 66 files 66 suites 1m 17s ⏱️ Results for commit 020dc70. ♻️ This comment has been updated with latest results. |
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.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
firebase-dataconnect/src/androidTest/kotlin/com/google/firebase/dataconnect/AuthIntegrationTest.kt:130
- Ensure that dataConnect is always an instance of FirebaseDataConnectInternal to avoid a potential ClassCastException. If there's any risk of a different type, consider using a safe cast and handling the error.
(dataConnect as FirebaseDataConnectInternal).awaitAuthReady()
firebase-dataconnect/src/androidTest/kotlin/com/google/firebase/dataconnect/AuthIntegrationTest.kt:159
- Ensure that dataConnect is always an instance of FirebaseDataConnectInternal to avoid a potential ClassCastException. If there's any risk of a different type, consider using a safe cast and handling the error.
(dataConnect as FirebaseDataConnectInternal).awaitAuthReady()
…henticatedFlakyTestFix
…henticatedFlakyTestFix
This PR fixes two tests in
AuthIntegrationTest.kt
that would flakily fail:queryShouldRetryOnUnauthenticated
andmutationShouldRetryOnUnauthenticated
.The fix was to ensure that FirebaseAuth was ready in the
FirebaseDataConnect
instance before starting the test. I had thought that the test was already doing this because thesignIn()
method callsawaitAuthReady()
on aFirebaseDataConnect
object; however, the test actually used a differentFirebaseDataConnect
object and no call toawaitAuthReady()
was made on it. As a result, occasionally the query would be executed before FirebaseAuth was ready and in those cases the test would fail. The fix was to simply callawaitAuthReady()
on the otherFirebaseDataConnect
object that was used by the test to run the query.Googlers can see b/399689249 for more details.