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
This commit is contained in:
Christopher Batey 2020-05-07 10:33:24 +01:00 committed by GitHub
parent 683868f9fe
commit 0a208f4cb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)