test(process): distinguish native startup from producer verification

This commit is contained in:
morluto
2026-10-09 04:12:49 +08:00
parent f591e37a1e
commit 9a70fb482c
3 changed files with 13 additions and 2 deletions
+6 -1
View File
@@ -1,12 +1,13 @@
import { randomUUID } from "node:crypto";
import { setTimeout as delay } from "node:timers/promises";
import { expect, it } from "vitest";
import { beforeAll, expect, it } from "vitest";
import {
OwnedCommandFailure,
runOwnedCommand,
} from "../../../src/process/OwnedCommand.js";
import { spawnOwnedProviderProcess } from "../../../src/process/ProviderProcess.js";
import { cleanupOwnedProcessGroup } from "../../../src/process/ProcessOwnership.js";
import { prepareProcessOwnershipInspection } from "../../../src/process/ProcessOwnershipObservation.js";
import { waitForProviderProcessReady } from "../../fixtures/providerProcess.js";
const command = (script: string) => ({
@@ -15,6 +16,10 @@ const command = (script: string) => ({
runId: `rea-owned-command-test-${randomUUID()}`,
});
// Output/exit cases start with a prepared inspector; startup deadline cases
// below inject their own preparation so they remain independent of compiler speed.
beforeAll(() => prepareProcessOwnershipInspection());
it("includes ownership preparation in the command deadline before provider creation", async () => {
let prepared = false;
await expect(
@@ -43,7 +43,7 @@ itWithCaptureCapability(
path: "root_0:state.txt",
}),
);
expect(result.value.cleanup).toEqual({
expect(result.value.cleanup).toMatchObject({
owned_process_group: "verified",
temporary_root: "removed",
});