Raise munit timeout for database-backed test suites - #891
Open
phdoerfler wants to merge 1 commit into
Open
Conversation
munit-cats-effect's 30s default is not enough headroom for the database-backed suites on a constrained machine: sbt runs each backend's tests in its own forked JVM, several of which contend for one docker daemon, and under that load individual tests have been observed to exceed 30s and fail with spurious TimeoutExceptions unrelated to what they test. Introduce a shared SqlDatabaseSuite base trait in sql-core's test scope, extended by DoobieDatabaseSuite and SqlPgDatabaseSuite (a single base rather than per-trait overrides, since DoobiePgDatabaseSuite mixes in both and separate overrides of munitIOTimeout would conflict), raising the timeout to 2 minutes for every backend suite.
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.
munit-cats-effect times a test out after 30 seconds, which isn't much headroom for the database-backed suites on a constrained machine. sbt runs each backend's tests in its own forked JVM and several of those contend for a single docker daemon, so a test can exceed 30s for reasons that have nothing to do with what it asserts. It surfaces as a
TimeoutExceptionin whichever suite happens to run first after the containers come up. I've seen it onEmbedding2Suite.paging,Paging3Suite.paging (initial)and skunk'sTreeSuite.root query, each of which passes on a rerun of the identical commit.This raises the timeout to two minutes for the backend suites. It's a single shared
SqlDatabaseSuitebase in sql-core's test scope rather than an override on each of the per-backend traits, becauseDoobiePgDatabaseSuitemixes in bothDoobieDatabaseSuiteandSqlPgDatabaseSuiteand two separate overrides ofmunitIOTimeoutwould conflict.The commit has been riding along in my four open backend PRs (#864, #866, #872, #873), which each carry a copy of it. It stands on its own and is useful to anyone running the suites locally, so it seemed better raised separately; those PRs can drop their copy at their next rebase.