diff --git a/modules/doobie-core/src/test/scala/DoobieDatabaseSuite.scala b/modules/doobie-core/src/test/scala/DoobieDatabaseSuite.scala index 44bde653..a92d8c5e 100644 --- a/modules/doobie-core/src/test/scala/DoobieDatabaseSuite.scala +++ b/modules/doobie-core/src/test/scala/DoobieDatabaseSuite.scala @@ -18,13 +18,12 @@ package grackle.doobie.test import java.time.Duration import io.circe.{Decoder => CDecoder, Encoder => CEncoder} -import munit.CatsEffectSuite import org.typelevel.doobie.Meta import grackle.doobie.DoobieMappingLike import grackle.sql.test._ -trait DoobieDatabaseSuite extends CatsEffectSuite { +trait DoobieDatabaseSuite extends SqlDatabaseSuite { trait DoobieTestMapping[F[_]] extends DoobieMappingLike[F] with SqlTestMapping[F] { type TestCodec[T] = (Meta[T], Boolean) diff --git a/modules/sql-core/src/test/scala/SqlDatabaseSuite.scala b/modules/sql-core/src/test/scala/SqlDatabaseSuite.scala new file mode 100644 index 00000000..6dcecbd3 --- /dev/null +++ b/modules/sql-core/src/test/scala/SqlDatabaseSuite.scala @@ -0,0 +1,30 @@ +// Copyright (c) 2016-2025 Association of Universities for Research in Astronomy, Inc. (AURA) +// Copyright (c) 2016-2025 Grackle Contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package grackle.sql.test + +import scala.concurrent.duration._ + +import munit.CatsEffectSuite + +/** + * Common base for the per-backend database suite traits, raising munit-cats-effect's 30s + * default timeout: database-backed tests can exceed it for reasons that have nothing to do with + * the test itself, e.g. several forked backend test JVMs contending for one docker daemon on a + * constrained machine, showing up as spurious timeouts rather than failures. + */ +trait SqlDatabaseSuite extends CatsEffectSuite { + override def munitIOTimeout: Duration = 2.minutes +} diff --git a/modules/sql-pg/js-jvm/src/test/scala/SqlPgDatabaseSuite.scala b/modules/sql-pg/js-jvm/src/test/scala/SqlPgDatabaseSuite.scala index a1c4965d..0650becc 100644 --- a/modules/sql-pg/js-jvm/src/test/scala/SqlPgDatabaseSuite.scala +++ b/modules/sql-pg/js-jvm/src/test/scala/SqlPgDatabaseSuite.scala @@ -15,9 +15,9 @@ package grackle.sqlpg.test -import munit.CatsEffectSuite +import grackle.sql.test.SqlDatabaseSuite -trait SqlPgDatabaseSuite extends CatsEffectSuite { +trait SqlPgDatabaseSuite extends SqlDatabaseSuite { case class PostgresConnectionInfo(host: String, port: Int) { val driverClassName = "org.postgresql.Driver"