Conversation
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
📝 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. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the InProcessDataConnectGrpcServer to support an optional responseDelay parameter, which is used to introduce a delay in gRPC server responses. This change is applied across several integration tests in AuthIntegrationTest.kt to prevent flakiness by ensuring the auth emulator has sufficient time to generate new tokens during retry attempts. Additionally, the signIn helper method was refactored to accept a FirebaseDataConnect instance directly, and the tests were updated to use this new signature. I have one piece of feedback regarding the queryShouldOnlyRetryOnUnauthenticatedOnce test, where adding a responseDelay would improve consistency with other similar tests.
...se-dataconnect/src/androidTest/kotlin/com/google/firebase/dataconnect/AuthIntegrationTest.kt
Show resolved
Hide resolved
…ldOnlyRetryOnUnauthenticatedOnce`, which was overlooked
Fixes test flakiness in
AuthIntegrationTest.ktby ensuring thatsignIn()waits for auth to be ready on the correctFirebaseDataConnectinstance and by introducing a response delay in the mock gRPC server to prevent the reuse of stale auth tokens from the emulator.The delay works around behaviour of the Firebase Auth emulator that it will produce identical tokens if called in rapid succession because it uses the current time as a basis for the tokens that it returns.
Highlights
AuthIntegrationTestto pass theFirebaseDataConnectinstance tosignIn(), ensuring the object is ready for auth operations.responseDelayparameter toInProcessDataConnectGrpcServerto simulate network latency and allow time for token updates.AuthIntegrationTestto use the newresponseDelay, specifically to avoid receiving the same access token twice from the auth emulator during retries.Changelog
View file-level changes
AuthIntegrationTest.kt: RefactoredsignInto accept adataConnectinstance, updated test cases to use this instance, and added delays to tests that retry on unauthenticated errors.InProcessDataConnectGrpcServer.kt: Added support for a configurableresponseDelayin the mock gRPC server using aServerInterceptor.