test(ci): verify decoded historical PID controls before tracing
This commit is contained in:
1 parent
b32ce58c3a
commit
b82ae1962f
2 files changed
+23
-2
No files matched your search
@@ -1,11 +1,19 @@
|
||||
import { connectRecordedCrash } from "./public.mjs";
|
||||
import assert from "node:assert/strict";
|
||||
|
||||
const session = await connectRecordedCrash({
|
||||
entrypoint: process.argv[2],
|
||||
environment: process.env,
|
||||
});
|
||||
try {
|
||||
await session.inspect("mcp", process.argv[3], { debuggerContext: true });
|
||||
const report = await session.inspect("mcp", process.argv[3], {
|
||||
debuggerContext: true,
|
||||
});
|
||||
const historicalPid = Number(process.argv[4]);
|
||||
assert.ok(
|
||||
report.threads.some((thread) => thread.historical_pid === historicalPid),
|
||||
"MCP must decode the selected historical-PID control before its trace qualifies",
|
||||
);
|
||||
} finally {
|
||||
await session.close();
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import { readdir, readFile, realpath } from "node:fs/promises";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { isAbsolute, join, resolve } from "node:path";
|
||||
import { runOwnedCommand } from "../../../dist/process/OwnedCommand.js";
|
||||
import { parseEvidence } from "../../../dist/domain/evidence.js";
|
||||
import {
|
||||
assertHistoricalPidReads,
|
||||
nodeInventoryThreads,
|
||||
@@ -50,8 +51,9 @@ export async function verifyCoreInspectionTrace({
|
||||
fileURLToPath(new URL("./trace-client.mjs", import.meta.url)),
|
||||
entrypoint,
|
||||
core,
|
||||
String(historicalPid),
|
||||
];
|
||||
await runOwnedCommand(
|
||||
const result = await runOwnedCommand(
|
||||
{
|
||||
command: environment.REA_VERIFY_STRACE_COMMAND,
|
||||
arguments: [
|
||||
@@ -73,6 +75,17 @@ export async function verifyCoreInspectionTrace({
|
||||
},
|
||||
{ timeoutMs: 90_000, diagnosticBytes: 1024 * 1024 },
|
||||
);
|
||||
if (mode === "cli") {
|
||||
const report = parseEvidence(
|
||||
JSON.parse(result.stdout.text),
|
||||
).normalized_result;
|
||||
assert.ok(
|
||||
report.threads.some(
|
||||
(thread) => thread.historical_pid === historicalPid,
|
||||
),
|
||||
"CLI must decode the selected historical-PID control before its trace qualifies",
|
||||
);
|
||||
}
|
||||
const executions = [];
|
||||
const ownershipReads = [];
|
||||
let gdbObserved = false;
|
||||
|
||||
Reference in new issue
Block a user