Commit 9bbe782
committed
fix(@angular/build): prevent unit-test vitest runner from hanging after tests complete
In non-watch mode, the vitest executor disposed the Vitest instance with
`close()`, which can wait indefinitely when a worker or service keeps the
event loop alive. The process then never exits even though all tests have
completed and their results were reported.
Use `exit()` instead when not in watch mode, mirroring the `vitest run`
CLI behavior: `exit()` arms an unref'd `teardownTimeout` safety net that
force-exits the process if teardown does not settle in time, while still
performing a normal `close()` when teardown succeeds. Watch mode behavior
is unchanged.
Fixes #328321 parent 8358805 commit 9bbe782
1 file changed
Lines changed: 10 additions & 1 deletion
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
209 | 218 | | |
210 | 219 | | |
211 | 220 | | |
| |||
0 commit comments