Skip to content

armgit / rea

Public Imported from GitHub
0

Reverse engineer anything with agents, from app behavior down to native binaries.

test(filesystem): bound FIFO regressions at consumers

morluto0bfb6e00abae
diff --git a/tests/boundary/filesystem/artifactInventoryRegularRoot.test.ts b/tests/boundary/filesystem/artifactInventoryRegularRoot.test.ts
index b2e4f6d78..00e823ee7 100644
--- a/tests/boundary/filesystem/artifactInventoryRegularRoot.test.ts
+++ b/tests/boundary/filesystem/artifactInventoryRegularRoot.test.ts
@@ -8,6 +8,7 @@ import { expect, it } from "vitest";
import { inventoryArtifact } from "../../../src/artifacts/inventory/ArtifactInventory.js";
import { classifyAndHashRoot } from "../../../src/artifacts/inventory/classify.js";
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
+import { readWithoutFifoWriter } from "../../fixtures/fifoInput.js";
it.skipIf(process.platform === "win32")(
"rejects a FIFO artifact root without waiting for a writer",
@@ -16,7 +17,16 @@ it.skipIf(process.platform === "win32")(
const fifoPath = join(root, "input.asar");
await promisify(execFile)("mkfifo", [fifoPath]);
- await expect(inventoryArtifact(fifoPath)).rejects.toMatchObject({
+ const outcome = await readWithoutFifoWriter(fifoPath, () =>
+ inventoryArtifact(fifoPath).then(
+ () => undefined,
+ (cause: unknown) => cause,
+ ),
+ );
+ expect(outcome.state).toBe("completed");
+ if (outcome.state !== "completed")
+ throw new Error("Artifact inventory waited for a FIFO writer");
+ expect(outcome.result).toMatchObject({
reason: "format",
message: `Artifact root is not a regular file: ${fifoPath}`,
});
diff --git a/tests/boundary/filesystem/binaryTarget.test.ts b/tests/boundary/filesystem/binaryTarget.test.ts
index 669ee9265..69ff26fab 100644
--- a/tests/boundary/filesystem/binaryTarget.test.ts
+++ b/tests/boundary/filesystem/binaryTarget.test.ts
@@ -24,29 +24,6 @@ import {
} from "../../../src/domain/binaryTarget.fixture.js";
import { projectAnalysisError } from "../../../src/domain/analysisErrorProjection.js";
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
-import { readWithoutFifoWriter } from "../../fixtures/fifoInput.js";
-
-it.skipIf(process.platform === "win32")(
- "rejects a selected FIFO without waiting for a writer",
- async () => {
- const root = await createTestTempDirectory("rea-binary-target-fifo-");
- const fifoPath = join(root, "input.bin");
- await promisify(execFile)("mkfifo", [fifoPath]);
- const outcome = await readWithoutFifoWriter(fifoPath, () =>
- parseBinaryTarget(fifoPath),
- );
- expect(outcome.state).toBe("completed");
- if (outcome.state !== "completed")
- throw new Error("Binary target resolution waited for a FIFO writer");
- expect(outcome.result).toMatchObject({
- ok: false,
- error: {
- _tag: "BinaryTargetError",
- reason: "target is not a regular file",
- },
- });
- },
-);
describe("binary target I/O: app plist permissions and decoding", () => {
it.each([
diff --git a/tests/boundary/mcp/openBinaryFifo.test.ts b/tests/boundary/mcp/openBinaryFifo.test.ts
index 27a2ee1b7..aedfc3d6c 100644
--- a/tests/boundary/mcp/openBinaryFifo.test.ts
+++ b/tests/boundary/mcp/openBinaryFifo.test.ts
@@ -35,7 +35,10 @@ it.skipIf(process.platform === "win32")(
throw new Error("MCP open_binary waited for a FIFO writer");
expect(outcome.result.isError).toBe(true);
expect(parseMcpToolError(outcome.result)).toMatchObject({
- error: { message: expect.stringContaining("not a regular file") },
+ error: {
+ code: "target_unavailable",
+ message: expect.stringContaining("not a regular file"),
+ },
});
} finally {
await Promise.allSettled([