Skip to content

Commit

Permalink
Log allocations/deallocations
Browse files Browse the repository at this point in the history
  • Loading branch information
adamw committed Jul 26, 2024
1 parent cdc0f25 commit 86a1c01
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/src/main/scalajvm/sttp/tapir/tests/TestSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ trait TestSuite extends AsyncFunSuite with BeforeAndAfterAll {

// we need to register the tests when the class is constructed, as otherwise scalatest skips it
val (allTests, doRelease) = tests.allocated.unsafeRunSync()
println(s"Allocated: ${getClass.getName}")

allTests.foreach { t =>
if (testNameFilter.forall(filter => t.name.contains(filter))) {
Expand All @@ -25,9 +26,11 @@ trait TestSuite extends AsyncFunSuite with BeforeAndAfterAll {
private val release = doRelease

override protected def afterAll(): Unit = {
println(s"Deallocating... ${getClass.getName}")
// the resources can only be released after all of the tests are run
release.unsafeRunSync()
shutdownDispatcher.unsafeRunSync()
println(s"Deallocating ${getClass.getName} done")
super.afterAll()
}
}

0 comments on commit 86a1c01

Please sign in to comment.