test: speed async lifecycle and parity coverage (#106605)

* test: speed up async lifecycle suites

* test: stabilize async speedups

* test: remove duplicated provider auth parity suite
This commit is contained in:
Peter Steinberger
2026-07-13 15:40:16 -07:00
committed by GitHub
parent 2e0f6d5304
commit 4e689a219d
3 changed files with 11 additions and 239 deletions

View File

@@ -889,7 +889,7 @@ describe("session MCP runtime", () => {
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "bundle-mcp-listtools-timeout-"));
const serverPath = path.join(tempDir, "hanging-list-tools.mjs");
const logPath = path.join(tempDir, "server.log");
testing.setBundleMcpCatalogListTimeoutMsForTest(100);
testing.setBundleMcpCatalogListTimeoutMsForTest(50);
await writeListToolsMcpServer({ filePath: serverPath, logPath, hang: true });
const runtime = await getOrCreateSessionMcpRuntime({
@@ -2250,7 +2250,7 @@ describe("disposeSession timeout", () => {
"force-closes transport and client when terminateSession hangs past the timeout",
{ timeout: 15_000 },
async () => {
testing.setBundleMcpDisposeTimeoutMsForTest(100);
testing.setBundleMcpDisposeTimeoutMsForTest(50);
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "bundle-mcp-force-close-"));
const serverPath = path.join(tempDir, "hanging-terminate.mjs");
const logPath = path.join(tempDir, "server.log");
@@ -2348,7 +2348,7 @@ process.stdin.on("end", () => {
"completes disposal even when the MCP server process ignores shutdown",
{ timeout: 15_000 },
async () => {
testing.setBundleMcpDisposeTimeoutMsForTest(100);
testing.setBundleMcpDisposeTimeoutMsForTest(50);
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "bundle-mcp-dispose-timeout-"));
const serverPath = path.join(tempDir, "hanging-close.mjs");
const logPath = path.join(tempDir, "server.log");
@@ -2441,7 +2441,7 @@ process.stdin.on("end", () => {
"force-closes streamable-http transport when DELETE hangs past the timeout",
{ timeout: 15_000 },
async () => {
testing.setBundleMcpDisposeTimeoutMsForTest(100);
testing.setBundleMcpDisposeTimeoutMsForTest(50);
const sessionId = "test-session-" + Date.now();
const server = http.createServer((req, res) => {
if (req.method === "GET") {
@@ -2624,7 +2624,7 @@ process.stdin.on("end", () => {
await writeListToolsMcpServer({
filePath: slowConnectServer.serverPath,
logPath: slowConnectServer.logPath,
initializeDelayMs: 500,
initializeDelayMs: 200,
});
testing.setBundleMcpCatalogListTimeoutMsForTest(4_000);

View File

@@ -22,6 +22,12 @@ vi.mock("./node-pairing-ssh-verify.runtime.js", () => ({
runNodeIdentityProbe: (params: NodeIdentityProbeParams) => probeMock(params),
}));
vi.mock("../skills/runtime/remote.js", async (importOriginal) => ({
...(await importOriginal<typeof import("../skills/runtime/remote.js")>()),
// Pairing coverage does not need the unrelated 5s connect-time bin refresh.
refreshRemoteNodeBins: vi.fn(async () => {}),
}));
installGatewayTestHooks({ scope: "suite" });
async function waitFor<T>(