#24104 Give a bit of time for consumers to register

This commit is contained in:
Martynas Mickevičius 2018-01-09 15:02:32 +07:00 committed by Konrad `ktoso` Malawski
parent f1de21950d
commit a3ae494325

View file

@ -313,6 +313,10 @@ class HubSpec extends StreamSpec {
downstream1.request(4)
downstream2.request(8)
// sending the first element is in a race with downstream subscribing
// give a bit of time for the downstream to complete subscriptions
Thread.sleep(50)
(1 to 8) foreach (upstream.sendNext(_))
downstream1.expectNext(1, 2, 3, 4)
@ -576,6 +580,10 @@ class HubSpec extends StreamSpec {
downstream1.request(4)
downstream2.request(8)
// to make sure downstream subscriptions are done before
// starting to send elements
Thread.sleep(50)
(0 until 16) foreach (upstream.sendNext(_))
downstream1.expectNext(0, 2, 4, 6)