Repository navigation
chore(firestore): prime IT backend once per JVM and increase pipeline seed timeout - #15035
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces thread-safe priming of the test backend in ITBaseTest by making backendPrimed static and volatile, wrapping the initialization logic in a synchronized block, and ensuring listener cleanup in a finally block. Additionally, the timeout in ITPipelineTest is increased from 5 to 30 seconds. The reviewer notes that since backendPrimed is a global static boolean, only the first database used in the test suite will be primed, while subsequent databases will skip priming. To resolve this and prevent transient timeouts, the reviewer suggests tracking primed databases using a static set of database IDs.
wu-hui
approved these changes
Nov 16, 2026
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.
ITBaseTest.backendPrimedwas declared as an instance field rather thanstatic, causing JUnit 4 to create a watch stream and prime the database before every@Testmethod instead of once per JVM. MakebackendPrimedstatic volatile(synchronized with listener cleanup infinally) and increase the per-document seed write timeout inITPipelineTest.testCollectionWithDocsfrom 5s to 30s to prevent transient@Beforesetup timeouts against named databases.b/580634723