From 34b954ec8a97d5e250c5f1291edd64688f40baca Mon Sep 17 00:00:00 2001 From: ShuaixinHuang <1836656514@qq.com> Date: Fri, 6 Nov 2026 14:33:21 +0800 Subject: [PATCH] test(cutter): synchronize peer descriptor close before cancellation (#9082) * test(cutter): synchronize peer descriptor close before cancellation * test(process): align symlink fixture with filesystem checkpoints * test(frida): assert the CLI spawn Evidence contract * test(mcp): use an unsupported analysis-view parent * test(browser): separate source-location line bounds from parity --- .../process-global/cutterDescriptorLifetime.test.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/process-global/cutterDescriptorLifetime.test.ts b/tests/process-global/cutterDescriptorLifetime.test.ts index 463f699abc..f0e6044626 100644 --- a/tests/process-global/cutterDescriptorLifetime.test.ts +++ b/tests/process-global/cutterDescriptorLifetime.test.ts @@ -236,8 +236,15 @@ it("does not assign a peer's later cancellation to a descriptor that already fai const gate = new Promise((resolve) => { release = resolve; }); + let firstClosing!: () => void; + const firstCloseStarted = new Promise((resolve) => { + firstClosing = resolve; + }); fault.onClose = async (handle) => { - if (handle === fault.handles[0]) return; + if (handle === fault.handles[0]) { + firstClosing(); + return; + } entered(); await gate; }; @@ -247,10 +254,11 @@ it("does not assign a peer's later cancellation to a descriptor that already fai .catch((cause: unknown) => cause); try { await awaitAcknowledgement( - waiting, + Promise.all([waiting, firstCloseStarted]).then(() => undefined), reading, "peer descriptor finalization", ); + // Let the first close rejection propagate while its peer remains gated. await new Promise((resolve) => setImmediate(resolve)); controller.abort(reason); release();