mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 03:48:56 +00:00
fix(test): nested Bun child should use --autokill flag
The nested child Bun process should also use --autokill to properly test the nested autokill behavior. This ensures both the parent and child Bun processes will kill their children when exiting. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -632,15 +632,15 @@ describe.skipIf(isWindows)("--autokill", () => {
|
||||
"nested_parent.js": `
|
||||
const { spawn } = require('child_process');
|
||||
|
||||
// Spawn a nested Bun process that spawns its own children
|
||||
// Spawn a nested Bun process with --autokill that spawns its own children
|
||||
const bunExe = process.argv[0];
|
||||
const childBun = spawn(bunExe, ['nested_child.js'], {
|
||||
const childBun = spawn(bunExe, ['--autokill', 'nested_child.js'], {
|
||||
cwd: __dirname
|
||||
});
|
||||
|
||||
console.log('parent-bun-pid:', childBun.pid);
|
||||
|
||||
// Exit after a delay, triggering autokill
|
||||
// Exit after a delay, triggering autokill on parent and nested child
|
||||
setTimeout(() => process.exit(0), 200);
|
||||
`,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user