Skip to content

Commit

Permalink
Fix executionTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
iRevive committed Dec 27, 2024
1 parent 81743f2 commit 4c319c2
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import scala.concurrent.duration._

class StripedHashtableSuite extends BaseSuite {

override def executionTimeout: FiniteDuration = 2.minutes
override def munitTimeout: FiniteDuration = 2.minutes

def hashtableRuntime(): IORuntime =
IORuntime(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import scala.concurrent.duration._

class ParasiticECSuite extends BaseSuite with TestInstances {

override def executionTimeout: FiniteDuration = 60.seconds
override def munitTimeout: FiniteDuration = 60.seconds

real("evaluate fibers correctly in presence of a parasitic execution context") {
val test = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import java.util.concurrent.CountDownLatch

class BlockingStressSuite extends BaseSuite {

override def executionTimeout: FiniteDuration = 30.seconds
override def munitTimeout: FiniteDuration = 30.seconds

// This test spawns a lot of helper threads.
private val count = 1000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import java.util.concurrent.CountDownLatch

class StripedHashtableSuite extends BaseSuite {

override def executionTimeout: FiniteDuration = 30.seconds
override def munitTimeout: FiniteDuration = 30.seconds

def hashtableRuntime(): IORuntime = {
lazy val rt: IORuntime = {
Expand Down
2 changes: 1 addition & 1 deletion tests/shared/src/test/scala/cats/effect/IOPropSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import munit.DisciplineSuite
//We allow these tests to have a longer timeout than IOSpec as they run lots of iterations
class IOPropSuite extends BaseSuite with DisciplineSuite {

override def executionTimeout: FiniteDuration = 2.minutes
override def munitTimeout: FiniteDuration = 2.minutes

realProp(
"parTraverseN should give the same result as parTraverse",
Expand Down
6 changes: 3 additions & 3 deletions tests/shared/src/test/scala/cats/effect/Runners.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ import munit.internal.PlatformCompat
trait Runners extends TestInstances with RunnersPlatform {
self: FunSuite =>

def executionTimeout: FiniteDuration = 20.seconds
override def munitTimeout: FiniteDuration = 20.seconds

def ticked(options: TestOptions)(body: Ticker => Any)(implicit loc: Location): Unit =
test(options)(body(Ticker(TestContext())))

def real[A](options: TestOptions)(body: => IO[A])(implicit loc: Location): Unit =
test(options) {
val (fut, cancel) = body.unsafeToFutureCancelable()(runtime())
timeout(fut, cancel, executionTimeout)
timeout(fut, cancel, munitTimeout)
}

/*
Expand All @@ -59,7 +59,7 @@ trait Runners extends TestInstances with RunnersPlatform {
test(options) {
val rt = runtime()
val (fut, cancel) = f(rt).unsafeToFutureCancelable()(rt)
timeout(fut, cancel, executionTimeout)
timeout(fut, cancel, munitTimeout)
}

def assertCompleteAs[A: Eq: Show](ioa: IO[A], expected: A)(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import scala.concurrent.duration._

class BoundedDequeueSuite extends BaseSuite with DequeueTests {

override def executionTimeout = 20.seconds
override def munitTimeout = 20.seconds

boundedDequeueTests(
"BoundedDequeue (forward)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import java.util.concurrent.atomic.AtomicInteger

class DispatcherSuite extends BaseSuite with DetectPlatform {

override def executionTimeout = 30.seconds
override def munitTimeout = 30.seconds

{
val D = Dispatcher.sequential[IO](await = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import scala.concurrent.duration._

final class MutexSuite extends BaseSuite with DetectPlatform {

final override def executionTimeout = 2.minutes
final override def munitTimeout = 2.minutes

tests("ConcurrentMutex", Mutex.apply[IO])
tests("Mutex with dual constructors", Mutex.in[IO, IO])
Expand Down
4 changes: 2 additions & 2 deletions tests/shared/src/test/scala/cats/effect/std/PQueueSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import scala.concurrent.duration._

class BoundedPQueueSuite extends BaseSuite with PQueueTests {

override def executionTimeout = 20.seconds
override def munitTimeout = 20.seconds

implicit val orderForInt: Order[Int] = Order.fromLessThan((x, y) => x < y)

Expand Down Expand Up @@ -113,7 +113,7 @@ class BoundedPQueueSuite extends BaseSuite with PQueueTests {

class UnboundedPQueueSuite extends BaseSuite with PQueueTests {

override def executionTimeout = 20.seconds
override def munitTimeout = 20.seconds

implicit val orderForInt: Order[Int] = Order.fromLessThan((x, y) => x < y)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import scala.concurrent.duration._
class UnsafeBoundedSuite extends BaseSuite {
import Queue.UnsafeBounded

override def executionTimeout = 30.seconds
override def munitTimeout = 30.seconds

// NB: emperically, it seems this needs to be > availableProcessors() to be effective
val length = 1000
Expand Down

0 comments on commit 4c319c2

Please sign in to comment.