From 67a8b914ee660d3bc3b1bf182e04b497f699bdca Mon Sep 17 00:00:00 2001 From: Affaan Mustafa Date: Mon, 11 May 2026 22:31:22 -0400 Subject: [PATCH] test: harden mcp health port readiness --- tests/hooks/mcp-health-check.test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); }