diff options
author | Heather Miller <heather.miller@epfl.ch> | 2012-04-15 14:51:18 +0200 |
---|---|---|
committer | Heather Miller <heather.miller@epfl.ch> | 2012-04-15 14:51:18 +0200 |
commit | e4bea920b42eaa526a9e07ad001f17443d6abeba (patch) | |
tree | c786202cc9d0fa5b1a26dfd8e1154cacca7fbaf4 /test/disabled/presentation/shutdown-deadlock/ShutdownDeadlockTest.scala | |
parent | 23aa1a8d7b08b767f90657baf9bc13a355682671 (diff) | |
parent | 364dd41c3e0e33afe6c3ec6e0c04f1d345c4b6ca (diff) | |
download | scala-e4bea920b42eaa526a9e07ad001f17443d6abeba.tar.gz scala-e4bea920b42eaa526a9e07ad001f17443d6abeba.tar.bz2 scala-e4bea920b42eaa526a9e07ad001f17443d6abeba.zip |
Merge branch 'master' of https://github.com/scala/scala into wip-sip14-fixes
Diffstat (limited to 'test/disabled/presentation/shutdown-deadlock/ShutdownDeadlockTest.scala')
-rw-r--r-- | test/disabled/presentation/shutdown-deadlock/ShutdownDeadlockTest.scala | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/disabled/presentation/shutdown-deadlock/ShutdownDeadlockTest.scala b/test/disabled/presentation/shutdown-deadlock/ShutdownDeadlockTest.scala new file mode 100644 index 0000000000..cef9d2a5ed --- /dev/null +++ b/test/disabled/presentation/shutdown-deadlock/ShutdownDeadlockTest.scala @@ -0,0 +1,45 @@ +import scala.tools.nsc.interactive._ +import tests._ + +object Test extends InteractiveTest { + val Reps = 30 + import compiler._ + + def askSomething(): Response[Tree] = { + // println("*") + Thread.sleep(50) + ask { compiler.askStructure(true)(sourceFiles.head, _) } + } + + def fireAsks() { + val jobs1 = for (i <- 1 until Reps) yield { + if (i % 10 == 0) { + askReload(sourceFiles) + } + askSomething + } + + for ((j, i) <- jobs1.zipWithIndex) { + j.get(40000) match { + case None => + println(i + ": TIMEOUT") + exit(1) // no need to delay the test any longer + case r => + } + } + compiler.askShutdown() + + println("No timeouts") + } + + override def main(args: Array[String]) { + new Thread("Asking") { + override def run() { + fireAsks() + } + }.start() + + Thread.sleep(800) + compiler.askShutdown() + } +}
\ No newline at end of file |