test(codex): stabilize app-server startup races · openclaw/openclaw@b96c0d9
vincentkoc
·
2026-06-03
·
via Recent Commits to openclaw:main
File tree
extensions/codex/src/app-server
| Original file line number | Diff line number | Diff line change |
|---|
@@ -408,9 +408,10 @@ describe("CodexAppServerClient", () => {
|
408 | 408 | // Start a pending request so we can verify it gets properly rejected. |
409 | 409 | const pending = harness.client.request("test/method"); |
410 | 410 | |
411 | | -// Simulate the child process closing its pipe — a write to the now-dead |
412 | | -// stdin emits an asynchronous EPIPE error on the stream. |
413 | | -harness.process.stdin.destroy(Object.assign(new Error("write EPIPE"), { code: "EPIPE" })); |
| 411 | +// Simulate the child process closing its pipe: stdin emits an asynchronous |
| 412 | +// EPIPE error before the transport observes a process exit. |
| 413 | +const pipeError = Object.assign(new Error("write EPIPE"), { code: "EPIPE" }); |
| 414 | +harness.process.stdin.emit("error", pipeError); |
414 | 415 | |
415 | 416 | // The pending request must be rejected with the pipe error rather than |
416 | 417 | // an unhandled exception tearing down the gateway. |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。