Commit f588241
committed
[kyo-reactive-streams] fix flaky hang in publisher-interruption test
PublisherToSubscriberTest "publisher's interuption should end all subscribed
parties" intermittently timed out (a 2m hang) on CI. latchPub only proves
publisher.subscribe was called for each subscriber; onSubscribe is delivered
asynchronously by the publisher's channel-consumer fiber. Interrupting the
publisher before a subscriber is established orphans it: it stays Uninitialized,
its emit-loop await blocks on a promise that only onSubscribe (or its own scope
teardown) can complete, and its run fiber hangs until the leaf timeout. A prior
change removed the settle sleep that had masked this, exposing the race.
Fix by ordering the interruption strictly after establishment: StreamSubscriber
now completes a dedicated `subscribed` promise when it leaves Uninitialized, and
exposes `awaitSubscribed`; the test awaits all four subscribers before
interrupting. The test then exercises real propagation to established parties
(no restored sleep, no manual subscriber interrupts) and no longer races setup.
Validated: the interruption leaf passes 15/15 loops on the JVM and on JS/Native.1 parent 4353a74 commit f588241
2 files changed
Lines changed: 21 additions & 0 deletions
File tree
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
| |||
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
| 41 | + | |
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
| |||
156 | 162 | | |
157 | 163 | | |
158 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
159 | 171 | | |
160 | 172 | | |
161 | 173 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
198 | 207 | | |
199 | 208 | | |
200 | 209 | | |
| |||
0 commit comments