diff --git a/akka-stream-tests/src/test/scala/akka/stream/io/OutputStreamSourceSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/io/OutputStreamSourceSpec.scala index 04bd25fe0d..76b1994392 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/io/OutputStreamSourceSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/io/OutputStreamSourceSpec.scala @@ -160,7 +160,10 @@ class OutputStreamSourceSpec extends StreamSpec(UnboundedMailboxConfig) { s.cancel() sourceProbe.expectMsg(GraphStageMessages.DownstreamFinish) - the[Exception] thrownBy outputStream.write(bytesArray) shouldBe a[IOException] + + awaitAssert { + the[Exception] thrownBy outputStream.write(bytesArray) shouldBe a[IOException] + } } "fail to materialize with zero sized input buffer" in {