Skip to content

Commit

Permalink
Wait for mssql container startup to complete
Browse files Browse the repository at this point in the history
The built-in LogMessageWaitStrategy doesn't work.
  • Loading branch information
kiendang committed Sep 12, 2024
1 parent 1850923 commit 5aafe6e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scalasql/test/src/example/MsSqlExample.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package scalasql.example
import org.testcontainers.containers.MSSQLServerContainer
import scalasql.Table
import scalasql.MsSqlDialect._
import scala.util.control.Breaks.{break, breakable}

object MsSqlExample {
case class ExampleProduct[T[_]](
Expand All @@ -20,6 +21,13 @@ object MsSqlExample {
mssql.acceptLicense()
mssql.addEnv("MSSQL_COLLATION", "Latin1_General_100_CI_AS_SC_UTF8")
mssql.start()

breakable {
while (true) {
if (mssql.getLogs().contains("The default collation was successfully changed.")) break()
}
}

mssql
}

Expand Down

0 comments on commit 5aafe6e

Please sign in to comment.