Skip to content

Commit f77aa30

Browse files
committed
ci: keep the installer MCP stub session from hanging the job
The stdio MCP server answers requests but never exits on stdin EOF, so the previous pipe blocked the step until the 15m job timeout. Feed the requests through a pipe held open by a trailing sleep (an immediate EOF closes the transport before it replies), then kill the process by name. Avoids the non-portable `timeout` (absent on macOS runners).
1 parent f59b396 commit f77aa30

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

.github/workflows/installers.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,23 @@ jobs:
6464
# Exercise the MCP server end-to-end without a backend. This is the
6565
# real check: a native image missing reflection/serialization metadata
6666
# starts fine but crashes here (UnsupportedFeatureError / HTTP 0).
67+
#
68+
# The stdio server answers as messages arrive but never exits on its
69+
# own, so: feed the requests through a pipe kept open by a trailing
70+
# sleep (an immediate EOF makes it close before replying), then kill
71+
# it by name. `timeout` is avoided — macOS runners don't ship it.
6772
echo "== MCP stub session (initialize + tools/list) =="
68-
init='{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"ci","version":"0"}}}'
69-
inited='{"jsonrpc":"2.0","method":"notifications/initialized"}'
70-
list='{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
71-
{ printf '%s\n' "$init" "$inited" "$list"; sleep 5; } \
72-
| "$BIN" --stub > mcp.out 2> mcp.err || true
73+
printf '%s\n' \
74+
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"ci","version":"0"}}}' \
75+
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
76+
'{"jsonrpc":"2.0","id":2,"method":"tools/list"}' > session.jsonl
77+
( cat session.jsonl; sleep 6 ) | "$BIN" --stub > mcp.out 2> mcp.err &
78+
sleep 9
79+
if command -v taskkill >/dev/null 2>&1; then
80+
taskkill //F //IM qtsurfer-mcp.exe >/dev/null 2>&1 || true
81+
else
82+
pkill -f qtsurfer-mcp 2>/dev/null || true
83+
fi
7384
cat mcp.out
7485
grep -q '"list_exchanges"' mcp.out \
7586
|| { echo "::error::tools/list did not return the expected tools"; cat mcp.err; exit 1; }

0 commit comments

Comments
 (0)