fix(process): protect unrelated Hopper during cleanup
This commit is contained in:
@@ -28,6 +28,7 @@ import {
|
||||
} from "./lib/mcp-verifier-results.mjs";
|
||||
import { openAndVerifyLargeFixture } from "./lib/real-hopper-pagination.mjs";
|
||||
import { completeVerifierRun, createVerifierRun } from "./lib/verifier-run.mjs";
|
||||
import { startUnrelatedHopperSentinel } from "./lib/unrelated-hopper-sentinel.mjs";
|
||||
const execFileAsync = promisify(execFile);
|
||||
const verifierRun = createVerifierRun();
|
||||
const timeout = 180_000;
|
||||
@@ -283,6 +284,8 @@ transport.stderr?.on("data", (chunk) => {
|
||||
if (stderrBytes <= 16_384) stderrChunks.push(chunk.toString("utf8"));
|
||||
});
|
||||
const client = new Client({ name: "real-hopper-verifier", version: "1.0.0" });
|
||||
const unrelatedHopper = await startUnrelatedHopperSentinel();
|
||||
let unrelatedHopperSurvived = false;
|
||||
let summary;
|
||||
|
||||
try {
|
||||
@@ -458,6 +461,7 @@ try {
|
||||
await transport.close();
|
||||
} finally {
|
||||
clearInterval(keepAlive);
|
||||
unrelatedHopperSurvived = await unrelatedHopper.verifyAndClose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -487,7 +491,7 @@ if (summary === undefined)
|
||||
const completedVerifierRun = await completeVerifierRun(verifierRun);
|
||||
await new Promise((resolve, reject) => {
|
||||
process.stdout.write(
|
||||
`${JSON.stringify({ verifier_run: completedVerifierRun, ...summary, cleanShutdown: true }, null, 2)}\n`,
|
||||
`${JSON.stringify({ verifier_run: completedVerifierRun, ...summary, unrelatedHopperSurvived, cleanShutdown: true }, null, 2)}\n`,
|
||||
(cause) => {
|
||||
if (cause) reject(cause);
|
||||
else resolve();
|
||||
|
||||
Reference in New Issue
Block a user