Skip to content

Raise munit timeout for database-backed test suites - #891

Open
phdoerfler wants to merge 1 commit into
typelevel:mainfrom
phdoerfler:topic/raise-munit-timeout
Open

Raise munit timeout for database-backed test suites#891
phdoerfler wants to merge 1 commit into
typelevel:mainfrom
phdoerfler:topic/raise-munit-timeout

Conversation

@phdoerfler

@phdoerfler phdoerfler commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

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 TimeoutException in whichever suite happens to run first after the containers come up. I've seen it on Embedding2Suite.paging, Paging3Suite.paging (initial) and skunk's TreeSuite.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 SqlDatabaseSuite base in sql-core's test scope rather than an override on each of the per-backend traits, because DoobiePgDatabaseSuite mixes in both DoobieDatabaseSuite and SqlPgDatabaseSuite and two separate overrides of munitIOTimeout would 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant