test(lifecycle): move local gate copies, tests/process-global and tests/boundary phase gates onto the shared harness (#11412)

* test(lifecycle): replace eight local gate helper copies with the shared harness

* test(lifecycle): count an arrival announced in the turn its operation settles

* test(lifecycle): move tests/process-global phase gates onto the shared harness (#11414)

* test(lifecycle): move tests/process-global phase gates onto the shared harness

* test(lifecycle): move tests/boundary filesystem and process phase gates onto the shared harness (#11418)

* test(lifecycle): move tests/boundary provider phase gates onto the shared harness

* test(lifecycle): move tests/boundary/mcp phase gates onto the shared harness (#11433)

* test(lifecycle): give each phaseGate hold its own promise so unhandled held rejections stay visible

* test(lifecycle): move tests/boundary browser, pcap and CLI worker phase gates onto the shared harness (#11437)

* test(lifecycle): move tests/boundary browser, pcap and CLI worker phase gates onto the shared harness

* test(lifecycle): move fixture-owned and arrival-only provider gates onto the shared harness (#11441)

* test(lifecycle): move src/server and provider phase gates onto the shared harness (#11447)

* test(lifecycle): move the remaining src server, Kuna copy, Frida and Ghidra phase gates onto the shared harness (#11471)
This commit is contained in:
morluto authored and GitHub committed 2026-11-16 04:49:19 +08:00
1 parent f5aeb90ec5
commit b4a2a79c55
123 files changed
+1507 -2914

No files matched your search

@@ -27,7 +27,7 @@ import {
createLinkedIl2cppMetadataFixture,
} from "../../fixtures/il2cpp/metadata.js";
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
import { awaitAcknowledgement } from "../../fixtures/lifecycleAcknowledgement.js";
import { phaseGate } from "../../support/lifecycleHarness.js";
afterEach(() => {
vi.restoreAllMocks();
@@ -485,23 +485,15 @@ it("bounds concurrent snapshots and retains active decoding until close complete
const root = await createTestTempDirectory("rea-il2cpp-provider-close-");
const path = join(root, "global-metadata.dat");
await writeFile(path, createIl2cppMetadataFixture().bytes);
let markEntered!: () => void;
const entered = new Promise<void>((resolve) => {
markEntered = resolve;
});
let resume!: () => void;
const release = new Promise<void>((resolve) => {
resume = resolve;
});
const decoding = phaseGate();
const provider = new Il2cppMetadataProvider(undefined, () => {
markEntered();
return release;
return decoding.hold();
});
const active = provider.inspect({ path });
let closed = false;
let closing: Promise<void> | undefined;
await withVerifierCleanup(async () => {
await awaitAcknowledgement(entered, active, "metadata decoding");
await decoding.reached(active, "metadata decoding");
closing = provider.close().then(() => {
closed = true;
});
@@ -520,7 +512,7 @@ it("bounds concurrent snapshots and retains active decoding until close complete
}
await setImmediate();
expect(closed).toBe(false);
resume();
decoding.release();
await closing;
expect((await active).ok).toBe(true);
expect(closed).toBe(true);
@@ -533,7 +525,7 @@ it("bounds concurrent snapshots and retains active decoding until close complete
expect(projectAnalysisError(afterClose.error).retryable).toBe(false);
}
}, [
resume,
decoding.release,
async () => {
await closing;
},
@@ -550,21 +542,13 @@ it("keeps occupied capacity retryable while the reader remains open", async () =
const root = await createTestTempDirectory("rea-il2cpp-provider-occupied-");
const path = join(root, "global-metadata.dat");
await writeFile(path, createIl2cppMetadataFixture().bytes);
let markEntered!: () => void;
const entered = new Promise<void>((resolve) => {
markEntered = resolve;
});
let resume!: () => void;
const release = new Promise<void>((resolve) => {
resume = resolve;
});
const decoding = phaseGate();
const provider = new Il2cppMetadataProvider(undefined, () => {
markEntered();
return release;
return decoding.hold();
});
const active = provider.inspect({ path });
await withVerifierCleanup(async () => {
await awaitAcknowledgement(entered, active, "metadata decoding");
await decoding.reached(active, "metadata decoding");
const refused = await provider.inspect({ path });
expect(refused.ok).toBe(false);
if (!refused.ok) {
@@ -581,7 +565,7 @@ it("keeps occupied capacity retryable while the reader remains open", async () =
});
}
}, [
resume,
decoding.release,
async () => {
await active;
},