Skip to content

Commit

Permalink
Decrease timeouts by factor of 10
Browse files Browse the repository at this point in the history
  • Loading branch information
mijicd committed May 8, 2019
1 parent 729a293 commit 709453f
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,16 @@ class TwitterSpec(implicit ee: ExecutionEnv) extends TestRuntime {
private def propagateInterrupts = {
implicit val timer = new JavaTimer(true)

val value = new AtomicInteger(0)
val futureTimeout = TwitterDuration.fromSeconds(3)
val taskTimeout = Duration.fromScala(1.second)
val future = Task(Future.sleep(futureTimeout).map(_ => value.incrementAndGet()))
val task = Task.fromTwitterFuture(future).timeout(taskTimeout)
val value = new AtomicInteger(0)
val futureDelay = TwitterDuration.fromMilliseconds(300)
val future = Task(Future.sleep(futureDelay).map(_ => value.incrementAndGet()))

val taskTimeout = Duration.fromScala(100.millis)
val task = Task.fromTwitterFuture(future).timeout(taskTimeout)

unsafeRun(task) must beNone

SECONDS.sleep(5)
MILLISECONDS.sleep(500)

value.get() ==== 0
}
Expand Down

0 comments on commit 709453f

Please sign in to comment.