mirror of
https://github.com/morluto/rea.git
synced 2026-11-06 23:06:18 +00:00
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
This commit is contained in:
1 parent
edd32e5af1
commit
34b954ec8a
1 file changed
+10
-2
@@ -236,8 +236,15 @@ it("does not assign a peer's later cancellation to a descriptor that already fai
|
||||
const gate = new Promise<void>((resolve) => {
|
||||
release = resolve;
|
||||
});
|
||||
let firstClosing!: () => void;
|
||||
const firstCloseStarted = new Promise<void>((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();
|
||||
|
||||
Reference in new issue
Block a user