Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dilate ScalaTest future timeout to 600ms (fixes #106) #107

Merged
merged 2 commits into from
Jul 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions contrib/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ lazy val contrib = (project in file(".")).

name := "akka-stream-contrib"

// By default scalatest futures time out in 150 ms, dilate that to 600ms.
// This should not impact the total test time as we don't expect to hit this
// timeout, and indeed it doesn't appear to.
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-F", "4")

libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-stream-testkit" % Common.AkkaVersion % "provided",
"junit" % "junit" % "4.12" % Test, // Common Public License 1.0
Expand Down
13 changes: 3 additions & 10 deletions contrib/src/test/scala/akka/stream/contrib/ValveSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,10 @@ class ValveSpec extends WordSpec with ScalaFutures {

whenReady(switchFut) { switch =>
after(100 millis, system.scheduler) {
val future: Future[Boolean] = switch.flip(Open)
whenReady(future, timeout(200 millis)) {
_ shouldBe true
}
switch.flip(Open)
}.futureValue shouldBe true

future
}

whenReady(seq, timeout(200 millis)) {
_ should contain inOrder (1, 2, 3)
}
seq.futureValue should contain inOrder (1, 2, 3)
}
}

Expand Down