diff --git a/tests/hooks/mcp-health-check.test.js b/tests/hooks/mcp-health-check.test.js index 02145ade..b637353f 100644 --- a/tests/hooks/mcp-health-check.test.js +++ b/tests/hooks/mcp-health-check.test.js @@ -128,7 +128,10 @@ function waitForFile(filePath, timeoutMs = 5000) { const started = Date.now(); while (Date.now() - started < timeoutMs) { if (fs.existsSync(filePath)) { - return fs.readFileSync(filePath, 'utf8'); + const content = fs.readFileSync(filePath, 'utf8'); + if (content.trim()) { + return content; + } } Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 25); }