From 08a74e55c15a8102d2b9184b29c5bc7474a4dd91 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Mon, 14 Jan 2013 11:53:55 +0100 Subject: Fix SI-6932 by enabling linearization of callback execution for the internal execution context of Future --- test/files/jvm/scala-concurrent-tck.scala | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/files/jvm') diff --git a/test/files/jvm/scala-concurrent-tck.scala b/test/files/jvm/scala-concurrent-tck.scala index b529bca38a..b2b4183564 100644 --- a/test/files/jvm/scala-concurrent-tck.scala +++ b/test/files/jvm/scala-concurrent-tck.scala @@ -134,6 +134,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() @@ -143,6 +149,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() } -- cgit v1.2.3