ci: keep validation fresh and preserve failed-shard reports (#2210)
Run the existing README consistency and Python producer guards from their CI owners. Execute full local validation fresh while preserving cached preparation, and permit scoped reuse of earlier portable build entries. Collect failed-shard diagnostics before enforcing success and publish compact, portable timing history only after a complete successful merge. Preserve installer truncation failure across supported Bash versions. Keep cancellation tests focused on the called MCP tool, observe server progress before timing target readiness, and retain delayed-startup, cancellation, cleanup, and live follow-up request assertions. Validation: all 32 CI jobs and the separate Go lane passed; 935 files, 9,630 cases, 9,544 passed, 86 skipped, zero failed. Controlled regressions and fault/restoration probes are recorded in PR #2210. Refs #2190. Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
This commit is contained in:
@@ -30,7 +30,7 @@ type CaptureOutcome =
|
||||
| { readonly kind: "partial"; readonly partial: unknown };
|
||||
|
||||
const captureScenario = (
|
||||
mode: "cooperative" | "ignoring" | "descendant",
|
||||
mode: "cooperative" | "ignoring" | "delayed-ignoring" | "descendant",
|
||||
root: string,
|
||||
additions: CaptureScenario = {},
|
||||
finalExitCode?: number,
|
||||
@@ -453,11 +453,13 @@ captureTest(
|
||||
"rea-finalization-cli-cancel-",
|
||||
);
|
||||
const cliScenarioPath = join(cliRoot, "scenario.json");
|
||||
// Match the other finalization cases' observation window. The old 300 ms
|
||||
// deadline could signal the fixture before it installed its handlers.
|
||||
await writeFile(
|
||||
cliScenarioPath,
|
||||
JSON.stringify(
|
||||
captureScenario("ignoring", cliRoot, {
|
||||
timeout_ms: 300,
|
||||
captureScenario("delayed-ignoring", cliRoot, {
|
||||
timeout_ms: 1_500,
|
||||
finalization_ms: 20_000,
|
||||
}),
|
||||
),
|
||||
@@ -527,18 +529,36 @@ captureTest(
|
||||
const mcpRoot = await createTestTempDirectory(
|
||||
"rea-finalization-mcp-cancel-",
|
||||
);
|
||||
const { client } = await connectLocalToolsMcp();
|
||||
const { client, call: callTool } = await connectLocalToolsMcp();
|
||||
const controller = new AbortController();
|
||||
const call = client.callTool(
|
||||
{
|
||||
name: "capture_process_scenario",
|
||||
arguments: captureScenario("ignoring", mcpRoot, {
|
||||
timeout_ms: 300,
|
||||
finalization_ms: 20_000,
|
||||
}),
|
||||
},
|
||||
{ signal: controller.signal },
|
||||
let reportStarted: (() => void) | undefined;
|
||||
const captureStarted = new Promise<void>((resolve) => {
|
||||
reportStarted = resolve;
|
||||
});
|
||||
const call = callTool(
|
||||
"capture_process_scenario",
|
||||
captureScenario("delayed-ignoring", mcpRoot, {
|
||||
timeout_ms: 1_500,
|
||||
finalization_ms: 20_000,
|
||||
}),
|
||||
{ signal: controller.signal, onprogress: () => reportStarted?.() },
|
||||
);
|
||||
// Observe rejection immediately: a failed readiness wait must not leave a
|
||||
// pending request to reject unhandled when the fixture closes its client.
|
||||
// The original promise remains available for the cancellation assertion.
|
||||
const observedCall = call.catch(() => undefined);
|
||||
onTestFinished(async () => {
|
||||
controller.abort();
|
||||
await observedCall;
|
||||
});
|
||||
// Start the fixture's readiness wait after the server begins this capture;
|
||||
// SDK schema preparation before dispatch is not target startup time.
|
||||
await Promise.race([
|
||||
captureStarted,
|
||||
call.then(() => {
|
||||
throw new Error("MCP capture completed before reporting startup");
|
||||
}),
|
||||
]);
|
||||
const mcpFixturePid = await waitForFinalization(mcpRoot);
|
||||
const mcpStarted = Date.now();
|
||||
controller.abort(new Error("cancel finalization acceptance fixture"));
|
||||
@@ -548,7 +568,7 @@ captureTest(
|
||||
).rejects.toThrow("cancel finalization acceptance fixture");
|
||||
await waitForProcessExit(mcpFixturePid);
|
||||
await expect(
|
||||
client.listTools(),
|
||||
client.listTools(undefined, { cacheMode: "refresh" }),
|
||||
"the server accepts a follow-up request after cancelling the capture",
|
||||
).resolves.toMatchObject({ tools: expect.any(Array) });
|
||||
expect(
|
||||
|
||||
Reference in New Issue
Block a user