Skip to content

Commit 80d9930

Browse files
committed
JDK 17: fix testUncaughtExceptionReporting
1 parent aaacf4d commit 80d9930

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/files/jvm/scala-concurrent-tck.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,11 +874,16 @@ trait CustomExecutionContext extends TestBase {
874874
latch.countDown()
875875
})
876876

877+
// scala/bug#12423, scala/scala#9680
878+
val threadDeathWaitingPeriod =
879+
if (scala.util.Properties.isJavaAtLeast("17")) 1000L
880+
else 10L
881+
877882
@tailrec def waitForThreadDeath(turns: Int): Boolean =
878883
if (turns <= 0) false
879884
else if ((thread ne null) && thread.isAlive == false) true
880885
else {
881-
Thread.sleep(10)
886+
Thread.sleep(threadDeathWaitingPeriod)
882887
waitForThreadDeath(turns - 1)
883888
}
884889

0 commit comments

Comments
 (0)