Skip to content

Commit

Permalink
Added more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nbronson committed Jan 14, 2011
1 parent 8122d42 commit 126bdd1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/test/scala/scala/concurrent/stm/RetrySuite.scala
Expand Up @@ -418,4 +418,17 @@ class RetrySuite extends FunSuite {
TxnExecutor.transformDefault( _ => orig ) 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.