From eca25dc9b3a952b87a07bd4063ed92f0d81e3914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ari=20Perkki=C3=B6?= Date: Sun, 3 Dec 2023 19:54:58 +0200 Subject: [PATCH] fix: set process name for idle workers (#4641) --- packages/vitest/src/runtime/child.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/vitest/src/runtime/child.ts b/packages/vitest/src/runtime/child.ts index 70e1c1ed312b..1311a20ae284 100644 --- a/packages/vitest/src/runtime/child.ts +++ b/packages/vitest/src/runtime/child.ts @@ -13,17 +13,17 @@ import { mockMap, moduleCache, startViteNode } from './execute' import { createSafeRpc, rpcDone } from './rpc' import { setupInspect } from './inspector' +try { + process.title = `node (vitest ${poolId})` +} +catch {} + async function init(ctx: ChildContext) { const { config, workerId, providedContext } = ctx process.env.VITEST_WORKER_ID = String(workerId) process.env.VITEST_POOL_ID = String(poolId) - try { - process.title = `node (vitest ${poolId})` - } - catch {} - let setCancel = (_reason: CancelReason) => {} const onCancel = new Promise((resolve) => { setCancel = resolve