diff options
author | Viktor Klang <viktor.klang@gmail.com> | 2013-01-14 11:53:55 +0100 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2013-01-22 23:29:51 +0100 |
commit | 5713c1b9b5642bb1813f9e5816d31a1bc5d70c60 (patch) | |
tree | 0db7a0e953f3b45ed05e9bfc86b2c37b520e5c49 /test | |
parent | 53d4ec0187416c72cd1f25d24c5811c7fd6574db (diff) | |
download | scala-5713c1b9b5642bb1813f9e5816d31a1bc5d70c60.tar.gz scala-5713c1b9b5642bb1813f9e5816d31a1bc5d70c60.tar.bz2 scala-5713c1b9b5642bb1813f9e5816d31a1bc5d70c60.zip |
Fix SI-6932 by enabling linearization of callback execution for the internal execution context of Future
Diffstat (limited to 'test')
-rw-r--r-- | test/files/jvm/scala-concurrent-tck.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/files/jvm/scala-concurrent-tck.scala b/test/files/jvm/scala-concurrent-tck.scala index 00ef91539d..7d79f20064 100644 --- a/test/files/jvm/scala-concurrent-tck.scala +++ b/test/files/jvm/scala-concurrent-tck.scala @@ -141,6 +141,12 @@ trait FutureCallbacks extends TestBase { assert(false) } } + + def testThatNestedCallbacksDoNotYieldStackOverflow(): Unit = { + val promise = Promise[Int] + (0 to 10000).map(Future(_)).foldLeft(promise.future)((f1, f2) => f2.flatMap(i => f1)) + promise.success(-1) + } testOnSuccess() testOnSuccessWhenCompleted() @@ -150,6 +156,7 @@ trait FutureCallbacks extends TestBase { // testOnFailureWhenSpecialThrowable(6, new scala.util.control.ControlThrowable { }) //TODO: this test is currently problematic, because NonFatal does not match InterruptedException //testOnFailureWhenSpecialThrowable(7, new InterruptedException) + testThatNestedCallbacksDoNotYieldStackOverflow() testOnFailureWhenTimeoutException() } |