Harden RateTransformationDocSpec: Use test patience rather than hadcode #26262

This commit is contained in:
Christopher Batey 2019-02-21 15:42:24 +00:00 committed by Johan Andrén
parent baa9c52254
commit ea8e3ace33

View file

@ -6,15 +6,16 @@ package docs.stream
import akka.stream._
import akka.stream.scaladsl._
import akka.stream.testkit._
import akka.stream.testkit.scaladsl._
import scala.util.Random
import scala.math._
import scala.concurrent.Await
import scala.concurrent.duration._
import scala.collection.immutable
import akka.testkit.{ AkkaSpec, TestLatch }
import scala.concurrent.Await
class RateTransformationDocSpec extends AkkaSpec {
implicit val materializer = ActorMaterializer()
@ -88,7 +89,7 @@ class RateTransformationDocSpec extends AkkaSpec {
.grouped(10)
.runWith(Sink.head)
val extrapolated = Await.result(fut, 100.millis)
val extrapolated = fut.futureValue
extrapolated.size shouldBe 10
extrapolated.sum shouldBe 10 * initial
}