Skip to content

Commit eca25dc

Browse files
authored
fix: set process name for idle workers (#4641)
1 parent 54d52d4 commit eca25dc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/vitest/src/runtime/child.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ import { mockMap, moduleCache, startViteNode } from './execute'
1313
import { createSafeRpc, rpcDone } from './rpc'
1414
import { setupInspect } from './inspector'
1515

16+
try {
17+
process.title = `node (vitest ${poolId})`
18+
}
19+
catch {}
20+
1621
async function init(ctx: ChildContext) {
1722
const { config, workerId, providedContext } = ctx
1823

1924
process.env.VITEST_WORKER_ID = String(workerId)
2025
process.env.VITEST_POOL_ID = String(poolId)
2126

22-
try {
23-
process.title = `node (vitest ${poolId})`
24-
}
25-
catch {}
26-
2727
let setCancel = (_reason: CancelReason) => {}
2828
const onCancel = new Promise<CancelReason>((resolve) => {
2929
setCancel = resolve

0 commit comments

Comments
 (0)