Commit 2c5365a
authored
🤖 fix: add module preloading to fix flaky stream error tests (#746)
Generated with `mux`
Fixes intermittent failures in:
- `tests/ipcMain/streamErrorRecovery.test.ts`
- `tests/ipcMain/sendMessage.errors.test.ts`
**Root cause**: Concurrent tests were racing on dynamic module imports
(tokenizer, AI SDK providers) which could cause intermittent failures
when modules weren't fully loaded before test execution.
**Fix**: Add `preloadTestModules()` call to `beforeAll` hooks inside the
`describeIntegration` blocks, ensuring modules are loaded before any
concurrent tests start.
Also moved `beforeAll`/`afterAll` hooks inside the `describeIntegration`
blocks so they only run when integration tests are enabled.1 parent 7fe9486 commit 2c5365a
File tree
2 files changed
+15
-3
lines changed- tests/ipcMain
2 files changed
+15
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
44 | | - | |
45 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
46 | 51 | | |
47 | 52 | | |
48 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
| |||
220 | 225 | | |
221 | 226 | | |
222 | 227 | | |
| 228 | + | |
| 229 | + | |
223 | 230 | | |
224 | 231 | | |
225 | 232 | | |
| |||
0 commit comments