Skip to content

Commit

Permalink
Merge pull request #30216 from nivox/fix-hubspec-test
Browse files Browse the repository at this point in the history
Fixed race condition in MergeHub draining test: 30207
  • Loading branch information
patriknw committed May 14, 2021
2 parents dd8b514 + 9fbc796 commit 877c4ee
Showing 1 changed file with 4 additions and 2 deletions.
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 877c4ee

Please sign in to comment.