mirror of
https://github.com/oven-sh/bun
synced 2026-02-13 04:18:58 +00:00
This commit fixes the autokill flag implementation and tests to work properly on Linux systems: ## Changes Made ### autokill.zig - Fixed deprecated `std.mem.tokenize` usage by replacing with `std.mem.tokenizeAny` - Improved `killProcessTreeRecursive` to kill parent first to prevent race conditions - Added better error handling to prevent infinite loops - Added validation for pid <= 0 to avoid invalid process operations ### autokill.test.ts - Completely rewrote tests using proper test harness patterns - Used `Bun.spawn` with `await using` pattern and `bunEnv` for consistency - Created focused, reliable tests that don't have timing issues - Added comprehensive test coverage: - Basic autokill flag functionality - Child process killing verification - Comparison with non-autokill behavior - Nested process handling ## Testing All tests now pass reliably on Linux. The autokill functionality works correctly for both direct children and nested process trees. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>