From 71cccddf296cb651d72b4a95ea0ecbd9cd80f14d Mon Sep 17 00:00:00 2001 From: Alistair Smith Date: Thu, 12 Feb 2026 19:40:09 -0800 Subject: [PATCH] fix inspect_port in initBake/second init, reorder exit code assertions in tests --- src/bun.js/VirtualMachine.zig | 2 ++ .../runtime-inspector/runtime-inspector-windows.test.ts | 8 ++++++-- test/js/bun/runtime-inspector/runtime-inspector.test.ts | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/bun.js/VirtualMachine.zig b/src/bun.js/VirtualMachine.zig index 1ae2b04470..dd0e940f9e 100644 --- a/src/bun.js/VirtualMachine.zig +++ b/src/bun.js/VirtualMachine.zig @@ -1235,6 +1235,7 @@ pub fn init(opts: Options) !*VirtualMachine { if (opts.smol) is_smol_mode = opts.smol; + vm.inspect_port = opts.inspect_port; vm.configureDebugger(opts.debugger); vm.body_value_hive_allocator = Body.Value.HiveAllocator.init(bun.typedAllocator(jsc.WebCore.Body.Value)); @@ -1494,6 +1495,7 @@ pub fn initBake(opts: Options) anyerror!*VirtualMachine { if (opts.smol) is_smol_mode = opts.smol; + vm.inspect_port = opts.inspect_port; vm.configureDebugger(opts.debugger); vm.body_value_hive_allocator = Body.Value.HiveAllocator.init(bun.typedAllocator(jsc.WebCore.Body.Value)); diff --git a/test/js/bun/runtime-inspector/runtime-inspector-windows.test.ts b/test/js/bun/runtime-inspector/runtime-inspector-windows.test.ts index dcc564e330..99771bd823 100644 --- a/test/js/bun/runtime-inspector/runtime-inspector-windows.test.ts +++ b/test/js/bun/runtime-inspector/runtime-inspector-windows.test.ts @@ -246,7 +246,9 @@ describe.skipIf(!isWindows)("Runtime inspector Windows file mapping", () => { stderr: "pipe", }); - expect(await debug1.exited).toBe(0); + const [debug1Stderr, debug1ExitCode] = await Promise.all([debug1.stderr.text(), debug1.exited]); + expect(debug1Stderr).toBe(""); + expect(debug1ExitCode).toBe(0); // Wait for the full banner const stderrReader1 = target1.stderr.getReader(); @@ -283,7 +285,9 @@ describe.skipIf(!isWindows)("Runtime inspector Windows file mapping", () => { stderr: "pipe", }); - expect(await debug2.exited).toBe(0); + const [debug2Stderr, debug2ExitCode] = await Promise.all([debug2.stderr.text(), debug2.exited]); + expect(debug2Stderr).toBe(""); + expect(debug2ExitCode).toBe(0); // Wait for the full banner const stderrReader2 = target2.stderr.getReader(); diff --git a/test/js/bun/runtime-inspector/runtime-inspector.test.ts b/test/js/bun/runtime-inspector/runtime-inspector.test.ts index 50b33d7792..7e552d335a 100644 --- a/test/js/bun/runtime-inspector/runtime-inspector.test.ts +++ b/test/js/bun/runtime-inspector/runtime-inspector.test.ts @@ -407,7 +407,9 @@ describe("Runtime inspector activation", () => { stdout: "pipe", stderr: "pipe", }); - expect(await debugProc.exited).toBe(0); + const [debugStderr, debugExitCode] = await Promise.all([debugProc.stderr.text(), debugProc.exited]); + expect(debugStderr).toBe(""); + expect(debugExitCode).toBe(0); // Wait for inspector banner and extract WS URL const { stderr: targetStderr } = await waitForDebuggerListening(targetProc.stderr);