Clean up processes in integration tests (#15102)

This commit is contained in:
Tommaso Sciortino
2025-12-15 11:11:08 -08:00
committed by GitHub
parent 217e2b0eb4
commit ec665ef405
19 changed files with 184 additions and 92 deletions
@@ -23,7 +23,7 @@
import { writeFileSync } from 'node:fs';
import { join } from 'node:path';
import { beforeAll, describe, it } from 'vitest';
import { describe, it, afterEach, beforeEach } from 'vitest';
import { TestRig } from './test-helper.js';
// Create a minimal MCP server that doesn't require external dependencies
@@ -166,9 +166,15 @@ rpc.send({
`;
describe('mcp server with cyclic tool schema is detected', () => {
const rig = new TestRig();
let rig: TestRig;
beforeAll(async () => {
beforeEach(() => {
rig = new TestRig();
});
afterEach(async () => await rig.cleanup());
it('mcp tool list should include tool with cyclic tool schema', async () => {
// Setup test directory with MCP server configuration
await rig.setup('cyclic-schema-mcp-server', {
settings: {
@@ -190,9 +196,7 @@ describe('mcp server with cyclic tool schema is detected', () => {
const { chmodSync } = await import('node:fs');
chmodSync(testServerPath, 0o755);
}
});
it('mcp tool list should include tool with cyclic tool schema', async () => {
const run = await rig.runInteractive();
await run.type('/mcp list');