Permalink
Browse files

Added more tests

  • Loading branch information...
nbronson committed Jan 14, 2011
1 parent 8122d42 commit 126bdd1ebc5f53d61cd3f1b27be5711425f6833a
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/test/scala/scala/concurrent/stm/RetrySuite.scala
@@ -418,4 +418,17 @@ class RetrySuite extends FunSuite {
TxnExecutor.transformDefault( _ => orig )
}
}
+
+ test("tighter timeout wins") {
+ val t0 = System.currentTimeMillis
+ intercept[InterruptedException] {
+ atomic.withRetryTimeout(100) { implicit txn =>
+ atomic.withRetryTimeout(1000) { implicit txn =>
+ retry
+ }
+ }
+ }
+ val elapsed = System.currentTimeMillis - t0
+ assert(elapsed >= 100 && elapsed < 150)
+ }
}

0 comments on commit 126bdd1

Please sign in to comment.