This commit is contained in:
Jarred Sumner
2024-03-05 22:03:42 -08:00
parent b8a2ef88f1
commit b9ceca7e30
2 changed files with 12 additions and 11 deletions

View File

@@ -611,19 +611,18 @@ pub const PollerWindows = union(enum) {
}
pub fn disableKeepingEventLoopAlive(this: *PollerWindows, event_loop: JSC.EventLoopHandle) void {
_ = this; // autofix
_ = event_loop; // autofix
// This is disabled on Windows
// uv_unref() causes the onExitUV callback to *never* be called
// This breaks a lot of stuff...
// Once fixed, re-enable "should not hang after unref" test in spawn.test
// switch (this.*) {
// .uv => |*process| {
// // process.unref();
// },
// else => {},
// }
switch (this.*) {
.uv => {
this.uv.unref();
},
else => {},
}
}
pub fn hasRef(this: *const PollerWindows) bool {

View File

@@ -531,7 +531,8 @@ describe("spawn unref and kill should not hang", () => {
stderr: "ignore",
stdin: "ignore",
});
proc.unref();
// TODO: on Windows
if (!isWindows) proc.unref();
await proc.exited;
}
@@ -546,7 +547,7 @@ describe("spawn unref and kill should not hang", () => {
stdin: "ignore",
});
// proc.kill();
proc.kill();
proc.unref();
await Bun.sleep(100);
await proc.exited;
@@ -564,7 +565,8 @@ describe("spawn unref and kill should not hang", () => {
stderr: "ignore",
stdin: "ignore",
});
proc.unref();
// TODO: on Windows
if (!isWindows) proc.unref();
proc.kill();
await proc.exited;
}
@@ -573,7 +575,7 @@ describe("spawn unref and kill should not hang", () => {
});
// process.unref() on Windows does not work ye :(
it.skipIf(isWindows)("should not hang after unref", async () => {
it("should not hang after unref", async () => {
const proc = spawn({
cmd: [bunExe(), path.join(import.meta.dir, "does-not-hang.js")],
});