next.js
ad426a1f - [test] Recover from a leftover build process on test retry

Commit
55 days ago
[test] Recover from a leftover build process on test retry When a `next start` test exceeds the per-test timeout while `next build` is still running, the build process is left running and tracked by the next instance, because the build phase of `NextStartInstance.start()` clears `childProcess` only when the process exits. `jest.retryTimes` then re-runs the test body in the same process, and `start()` immediately throws `next already started`, which masks the original timeout. `NextStartInstance` now tracks whether a build or a server currently owns the child process. When `start()` finds a leftover `next build` process from an interrupted attempt, it stops that process and continues instead of throwing, so the retry can start from a clean state. The `next already started` guard is preserved for the case where a server is genuinely already running.
Author
Parents
Loading