From 95e60f4e853c628b7e69cfdc9f68e103b5699edf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Andr=C3=A9n?= Date: Wed, 9 Mar 2022 18:01:31 +0100 Subject: [PATCH] Failed: hub spec #31028 --- .../src/test/scala/akka/stream/scaladsl/HubSpec.scala | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/HubSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/HubSpec.scala index b42b3cb441..0c9606e54a 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/HubSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/HubSpec.scala @@ -698,8 +698,15 @@ class HubSpec extends StreamSpec { (0 until 16).foreach(upstream.sendNext(_)) - downstream1.expectNext(0, 2, 4, 6) + downstream1.expectNext(0, 2, 4, 6) // 8, 10, 12, 14 stays in buffer bc no demand + // if we don't demand more from downstream 1 here, there is a race condition where + // demand from downstream 2 is lost, because the buffer was full with elements for the other partition + // however this is likely because of the very fine grained demand logic in this test and not likely + // to happen in reality where both downstreams are likely going to keep pulling, or canceling + // for a scenario where one dosntream continous back pressures, head of line blocking can anyway happen + downstream1.request(1) downstream2.expectNext(1, 3, 5, 7, 9, 11, 13, 15) + downstream1.expectNext(8) downstream1.expectNoMessage(100.millis) downstream2.expectNoMessage(100.millis)