Repository navigation
Commit fabfcb4
committed
testing: event-pump tests on stub HttpClient + TestClock (comms-e5vm.2)
Tier-2 proof: migrate the event-pump / long-poll LOGIC tests off the real
Bun.serve realm onto the owned-fake stub HttpClient driven by TestClock,
exercised through the full adapter stack. Deterministic, no socket.
- Extend the stub seam with a hang ({ hang: true }) response variant that
parks on Effect.never. An instant in-memory stub has no long-poll *hold*,
so an eager Stream.runDrain would burn through the whole response sequence
in a hot loop; the hang models the hold (and stops one iterator racing
ahead into another's BAD_EVENT_QUEUE_ID). The downstream Tier-2 migrations
(.3/.7/.8) drive the same stack and get it from the shared seam.
- New packages/zulip/adapter-events.test.ts on stub + TestClock via
effectTest: gap-replay watermark across iterator instances (comms-4au),
429 RATE_LIMIT_HIT recovery on /events and /register (comms-9wi),
BAD_EVENT_QUEUE_ID reconnect + inbox.replay() gap-backfill (comms-jnn),
cursor/heartbeat advancement, and the scope-close fiber-interrupt (spj3.8).
- Delete the migrated tests and the happy-path live-contract duplicates
(first .next, mention-received) from adapter.test.ts. The rest of
adapter.test.ts stays on the realm for comms-e5vm.3.
Dissolves the real-socket contention flake structurally: the hanging
long-poll tests leave the realm-bound file, so comms-hbm9 auto-resolves.
Tier-3 residue for comms-4lz5: the genuine AbortSignal -> fetch -> TCP
teardown of an in-flight FetchHttpClient long-poll on scope close stays one
real-socket test; the stub only proves the Effect fiber-interrupt logic.1 parent 2e0f52c commit fabfcb4
4 files changed
Lines changed: 569 additions & 614 deletions
File tree
- packages
- testing
- zulip
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
205 | 228 | | |
206 | 229 | | |
207 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
29 | 42 | | |
30 | 43 | | |
31 | 44 | | |
| |||
34 | 47 | | |
35 | 48 | | |
36 | 49 | | |
| 50 | + | |
| 51 | + | |
37 | 52 | | |
38 | 53 | | |
39 | 54 | | |
| |||
87 | 102 | | |
88 | 103 | | |
89 | 104 | | |
90 | | - | |
| 105 | + | |
91 | 106 | | |
92 | 107 | | |
93 | 108 | | |
94 | 109 | | |
95 | 110 | | |
96 | | - | |
| 111 | + | |
97 | 112 | | |
98 | 113 | | |
99 | 114 | | |
100 | 115 | | |
101 | 116 | | |
102 | | - | |
| 117 | + | |
103 | 118 | | |
104 | 119 | | |
105 | 120 | | |
| |||
155 | 170 | | |
156 | 171 | | |
157 | 172 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
166 | 185 | | |
167 | 186 | | |
168 | 187 | | |
| |||
0 commit comments