Repository navigation
Warm the MySQL ready pool before EnsureTemplate returns - #12
Merged
Merged
Conversation
The first GOMAXPROCS tests of a package used to find an empty pool and clone on demand. EnsureTemplate now waits for the pool to fill once, which costs one round of parallel clones, so every test from the first takes a prepared database; WithReadyWarmup(false) skips the wait. A ctx that ends during the warm-up releases the template on the way out. Also says, in the package and clone docs, what a clone deliberately does not copy: events (a scheduler job firing inside a test's clone would make it nondeterministic) and grants (tests connect as the admin user); that DEFINER clauses are dropped; and that a foreign key to another database keeps pointing there. The package doc no longer says templates are unavailable.
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Two of the three items from the limits discussion.
Warm-up by default. The first
GOMAXPROCStests of a package used to find an empty pool and clone on demand (~0.5–0.8 s each).EnsureTemplatenow waits for the pool to fill once before returning: one round of parallel clones, paid once inTestMain, after which every test from the first takes a prepared database.WithReadyWarmup(false)skips the wait for anyone who wants tests to start immediately. A context that ends during the warm-up releases the template on the way out, with a test that proves nothing is left behind (256 clones against a 500 ms deadline).What the clone deliberately skips, written down. Events (a scheduler job firing inside a test's clone would make the test nondeterministic) and grants (tests connect as the admin user);
DEFINERclauses are dropped so objects belong to whoever runs the clone; a foreign key to a table in another database keeps pointing there. The package doc no longer claims templates are unavailable for MySQL.The third item, MariaDB in CI, is its own PR next.