mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 03:18:53 +00:00
fixups
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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")],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user