mirror of
https://github.com/jason5ng32/MyIP.git
synced 2026-11-04 08:55:47 +00:00
The pino-pretty transport runs in a worker thread. In a loaded parallel run, a spec that logs shortly before finishing could occasionally be kept alive by that thread and never exit, stalling the whole suite until the CI timeout. `pnpm test` now preloads tests/setup.js, which switches the logger to its synchronous JSON output unless LOG_FORMAT is already set. Runtime logging is unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
6 lines
301 B
JavaScript
6 lines
301 B
JavaScript
// Preloaded by `pnpm test` (node --import) before any spec. Keeps the shared
|
|
// logger off its pino-pretty worker thread: under a loaded parallel run that
|
|
// thread can keep a finished spec process from exiting. JSON output writes
|
|
// synchronously, with no worker.
|
|
process.env.LOG_FORMAT ??= 'json';
|