Skip to content

Commit 84ed030

Browse files
authored
Merge pull request #235 from armanbilge/topic/deprecate-munit-timeout
Add migratory deprecation to `munitTimeout`
2 parents 4a1b744 + bbb45f6 commit 84ed030

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

core/src/main/scala/munit/CatsEffectSuite.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ abstract class CatsEffectSuite
5454
* to set this to a greater value than [[munitIOTimeout]], which performs graceful cancelation of
5555
* [[cats.effect.IO IO]]-based tests. The default grace period for cancelation is 1 second.
5656
*/
57+
@deprecatedOverriding(
58+
"Override munitIOTimeout instead. This method will not be finalized, but the only reason to" +
59+
"override it would be to adjust the grace period for fiber cancelation (default 1 second).",
60+
"2.0.0"
61+
)
5762
override def munitTimeout: Duration = munitIOTimeout + 1.second
5863

5964
override def munitValueTransforms: List[ValueTransform] =

core/src/test/scala/munit/CatsEffectSuiteSpec.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@
1717
package munit
1818

1919
import cats.effect.{IO, SyncIO}
20+
import scala.annotation.nowarn
2021
import scala.concurrent.Future
2122
import scala.concurrent.duration._
2223

2324
class CatsEffectSuiteSpec extends CatsEffectSuite {
2425

2526
override def munitIOTimeout = 100.millis
27+
28+
@nowarn
2629
override def munitTimeout = Int.MaxValue.nanos // so only our timeout is in effect
2730

2831
test("times out".fail) { IO.sleep(1.second) }

0 commit comments

Comments
 (0)