Skip to content

Commit 1d0d820

Browse files
committed
fix
Signed-off-by: aaronzuo <anarionzuo@outlook.com>
1 parent 2f2d145 commit 1d0d820

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

.github/workflows/unit_tests.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,34 @@ jobs:
108108
curl -fsS http://127.0.0.1:6566/health >/dev/null
109109
- name: Validate MCP endpoint
110110
run: |
111-
rm -f /tmp/mcp_headers
111+
rm -f /tmp/mcp_headers /tmp/mcp_headers2
112+
113+
curl -sS -D /tmp/mcp_headers -o /dev/null --max-time 10 \
114+
-H "Accept: text/event-stream, application/json" \
115+
-H "mcp-protocol-version: 2025-03-26" \
116+
http://127.0.0.1:6566/mcp || true
117+
118+
SESSION_ID=$(grep -i "^mcp-session-id:" /tmp/mcp_headers | head -1 | awk '{print $2}' | tr -d '\r')
119+
if [ -z "${SESSION_ID}" ]; then
120+
cat /tmp/mcp_headers || true
121+
exit 1
122+
fi
123+
112124
for i in $(seq 1 10); do
113-
curl -sS -D /tmp/mcp_headers -o /dev/null --max-time 10 \
125+
rm -f /tmp/mcp_headers2
126+
curl -sS -D /tmp/mcp_headers2 -o /dev/null --max-time 10 \
114127
-H "Accept: text/event-stream, application/json" \
115128
-H "mcp-protocol-version: 2025-03-26" \
129+
-H "mcp-session-id: ${SESSION_ID}" \
116130
http://127.0.0.1:6566/mcp || true
117-
if grep -Eq "^HTTP/.* 200" /tmp/mcp_headers && grep -Eiq "^content-type: text/event-stream" /tmp/mcp_headers; then
131+
if grep -Eq "^HTTP/.* 200" /tmp/mcp_headers2 && grep -Eiq "^content-type: text/event-stream" /tmp/mcp_headers2; then
118132
exit 0
119133
fi
120134
sleep 1
121135
done
136+
122137
cat /tmp/mcp_headers || true
138+
cat /tmp/mcp_headers2 || true
123139
exit 1
124140
- name: Stop feature server
125141
if: always()

0 commit comments

Comments
 (0)