Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion __tests__/daemon-registry.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect, beforeEach, afterEach, onTestFinished, vi } from 'vitest';
import { describe, it, expect, beforeAll, afterAll, beforeEach, afterEach, onTestFinished, vi } from 'vitest';
import { execFileSync, spawn } from 'child_process';
import * as fs from 'fs';
import * as net from 'net';
Expand Down Expand Up @@ -60,6 +60,22 @@ function startDetachedProcess(): number {
return pid;
}

/**
* Same allowance daemon-lock-holder.test.ts makes: each OS lookup gets a
* minute, not the 5 s production default — on a loaded runner PowerShell can
* take longer to start, and a timed-out Windows lookup returns no command
* line, flipping 'not-running' verdicts to 'unverified'.
*/
const LOOKUP_ENV = 'CODEGRAPH_PROCESS_LOOKUP_TIMEOUT_MS';
const savedLookupTimeout = process.env[LOOKUP_ENV];
beforeAll(() => {
process.env[LOOKUP_ENV] = '60000';
});
afterAll(() => {
if (savedLookupTimeout === undefined) delete process.env[LOOKUP_ENV];
else process.env[LOOKUP_ENV] = savedLookupTimeout;
});

describe('daemon-registry', () => {
let tmpHome: string;
let prevHome: string | undefined;
Expand Down
17 changes: 16 additions & 1 deletion __tests__/mcp-daemon.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* end is itself the proof the canonicalization works.
*/

import { afterEach, beforeEach, describe, expect, it } from 'vitest';
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it } from 'vitest';
import { ChildProcessWithoutNullStreams, spawn } from 'child_process';
import * as fs from 'fs';
import * as net from 'net';
Expand Down Expand Up @@ -265,6 +265,21 @@ async function staleIndex(root: string): Promise<Buffer> {
return before;
}

/**
* Same allowance daemon-lock-holder.test.ts makes: each OS lookup gets a
* minute, not the 5 s production default — on a loaded runner PowerShell can
* take longer to start, and lookups time out while handovers wait on them.
*/
const LOOKUP_ENV = 'CODEGRAPH_PROCESS_LOOKUP_TIMEOUT_MS';
const savedLookupTimeout = process.env[LOOKUP_ENV];
beforeAll(() => {
process.env[LOOKUP_ENV] = '60000';
});
afterAll(() => {
if (savedLookupTimeout === undefined) delete process.env[LOOKUP_ENV];
else process.env[LOOKUP_ENV] = savedLookupTimeout;
});

describe('Shared MCP daemon (issue #411)', () => {
let tempDir: string; // the (possibly symlinked) path processes are spawned with
let realRoot: string; // its canonical form — what the daemon keys paths on
Expand Down
Loading