Harden RateTransformationDocSpec: Use test patience rather than hadcode #26262
This commit is contained in:
parent
baa9c52254
commit
ea8e3ace33
1 changed files with 4 additions and 3 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue