From 0a208f4cb86d842d32e944a8a57e13f1f4438cf3 Mon Sep 17 00:00:00 2001 From: Christopher Batey Date: Thu, 7 May 2020 10:33:24 +0100 Subject: [PATCH] Fix race condition in InputStreamSinkSpec (#28990) There's only one read so it was relying on both the Data and the Failed being in the shared queue when it takes place. Remove the data so that the poll on the shared queue will wait for the Failed to be added. Ref #28829 --- .../src/test/scala/akka/stream/io/InputStreamSinkSpec.scala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/akka-stream-tests/src/test/scala/akka/stream/io/InputStreamSinkSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/io/InputStreamSinkSpec.scala index fe40010579..3deeea3de7 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/io/InputStreamSinkSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/io/InputStreamSinkSpec.scala @@ -263,10 +263,8 @@ class InputStreamSinkSpec extends StreamSpec(UnboundedMailboxConfig) { "propagate error to InputStream" in { val readTimeout = 3.seconds - val (probe, inputStream) = + val (probe, inputStream: InputStream) = TestSource.probe[ByteString].toMat(StreamConverters.asInputStream(readTimeout))(Keep.both).run() - - probe.sendNext(ByteString("one")) val error = new RuntimeException("failure") probe.sendError(error) val buffer = Array.ofDim[Byte](5)