File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
core/src/test/scala/scala/scalanative/loop Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package scala.scalanative.loop
3
3
import utest ._
4
4
import scala .concurrent .duration ._
5
5
import scala .concurrent .ExecutionContext .Implicits .global
6
- import scala .concurrent .Promise
6
+ import scala .concurrent .{ Future , Promise }
7
7
8
8
object TimerTests extends LoopTestSuite {
9
9
val tests = Tests {
@@ -64,5 +64,12 @@ object TimerTests extends LoopTestSuite {
64
64
}
65
65
p.future
66
66
}
67
+ test(" deadlock when futures need event loop run to unlock" ) {
68
+ var completed = false
69
+ def recursive (): Future [Unit ] = if (! completed) Future (recursive()) else Future .successful(())
70
+ val r = recursive()
71
+ Timer .timeout(10 .millis)(() => completed = true )
72
+ r
73
+ }
67
74
}
68
75
}
You can’t perform that action at this time.
0 commit comments