* A live process standing in for a daemon that does not answer its socket. * Its command line reads like a CodeGraph MCP server's: one that is plainly * some other program would make the lock stale, and `index` would clear it * (#2770).
()
| 66 | * (#2770). |
| 67 | */ |
| 68 | function startDetachedProcess(): number { |
| 69 | const source = [ |
| 70 | "const { spawn } = require('child_process');", |
| 71 | "const child = spawn(process.execPath, ['-e', 'setInterval(() => {}, 1000)', 'codegraph.js', 'serve', '--mcp'], { detached: true, stdio: 'ignore' });", |
| 72 | 'child.unref();', |
| 73 | 'console.log(child.pid);', |
| 74 | ].join(' '); |
| 75 | const pid = Number(execFileSync(process.execPath, ['-e', source], { encoding: 'utf8' }).trim()); |
| 76 | if (!Number.isInteger(pid) || pid <= 0) throw new Error('could not start daemon fixture'); |
| 77 | return pid; |
| 78 | } |
| 79 | |
| 80 | describe('codegraph index — full re-index keeps the graph populated (#874)', () => { |
| 81 | let tempDir: string; |
no test coverage detected