Skip to content

Commit 0843dc1

Browse files
committed
Try to make test more robust
1 parent 4418125 commit 0843dc1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/shared/src/main/scala/catseffect/examples.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,12 @@ package examples {
8383
} catch {
8484
case _: TimeoutException => println("sadness (timeout)")
8585
}
86-
Thread.sleep(500L)
87-
// by now the WSTP (and all its threads) must've been shut down:
8886
if (thread eq null) println("sadness (thread is null)")
89-
else if (thread.isAlive()) println("sadness (thread is alive)")
87+
else {
88+
thread.join(2000)
89+
// by now the WSTP (and all its threads) must've been shut down:
90+
if (thread.isAlive()) println("sadness (thread is alive)")
91+
}
9092
println("done")
9193
}
9294
}

0 commit comments

Comments
 (0)