fix(windows) socket and timers/performance tests (#9651)

* WIP missing keepalive

* cleanup

* is a Bun.sleep bug?

* no bun sleep

* fix exception

* revert

* fix setTimeout/Bun.sleep

* add Bun.sleep keepalive test

* fixes

* one more bonus fix

* fix early firing of timers

* use localhost and pass the server.hostname

* opsie
This commit is contained in:
Ciro Spaciari
2024-03-27 14:31:12 -03:00
committed by GitHub
parent aee8eeaf45
commit d030cce8bb
8 changed files with 66 additions and 53 deletions

View File

@@ -1206,7 +1206,7 @@ pub const PipeReader = struct {
const owned = this.toOwnedSlice();
this.state = .{ .done = owned };
if (!this.isDone()) return;
// we need to ref because the process might be done and deref inside signalDoneToCmd before we call onCloseIO
// we need to ref because the process might be done and deref inside signalDoneToCmd and we wanna to keep it alive to check this.process
this.ref();
defer this.deref();
this.trySignalDoneToCmd();
@@ -1325,6 +1325,9 @@ pub const PipeReader = struct {
bun.default_allocator.free(this.state.done);
}
this.state = .{ .err = err.toSystemError() };
// we need to ref because the process might be done and deref inside signalDoneToCmd and we wanna to keep it alive to check this.process
this.ref();
defer this.deref();
this.trySignalDoneToCmd();
if (this.process) |process| {
// this.process = null;