Commit 8bb592c
fix(node-sdk): deflake
The `Preferences > should stream preferences` test ended its stream on a
fixed 100ms timer, far shorter than the 2000ms used by every other
streaming test. The two HmacKeyUpdate events depend on network
propagation of newly-registered installations, so the 4th update
frequently arrived after the 100ms window, ending the stream early and
failing with `expected 3 to be 4`.
Collect updates until all 4 expected preferences arrive, then end the
stream, with a generous 10s safety-net timeout so a genuine regression
fails with the same clear assertion instead of hanging.
Resolves #3831
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>should stream preferences test1 parent 701cc12 commit 8bb592c
1 file changed
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
209 | 215 | | |
210 | | - | |
| 216 | + | |
211 | 217 | | |
212 | | - | |
213 | 218 | | |
214 | 219 | | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
215 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
216 | 227 | | |
217 | 228 | | |
218 | 229 | | |
| |||
0 commit comments