Skip to content

Commit

Permalink
Fixed race condition in MergeHub draining test: 30207
Browse files Browse the repository at this point in the history
  • Loading branch information
nivox committed May 3, 2021
1 parent 099e20e commit 9fbc796
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,16 @@ class HubSpec extends StreamSpec {
draining.drainAndComplete()

downstream.request(10)
downstream.expectNextN(10).sorted should ===(1 to 10)
val firstBatch = downstream.expectNextN(10)

val upstream = TestPublisher.probe[Int]()
Source.fromPublisher(upstream).runWith(sink)
upstream.expectCancellation()

downstream.request(10)
downstream.expectNextN(10).sorted should ===(11 to 20)
val secondBatch = downstream.expectNextN(10)

(firstBatch ++ secondBatch).sorted should ===(1 to 20)

downstream.expectComplete()
}
Expand Down

0 comments on commit 9fbc796

Please sign in to comment.