simplify Athena runtime and centralize MCP management
This commit is contained in:
@@ -183,6 +183,34 @@ echo "$RESP"
|
||||
echo "$RESP" | grep -q "data: " && echo "$RESP" | grep -q "\[DONE\]" \
|
||||
&& ok "SSE-Stream mit [DONE] erhalten" || bad "Streaming"
|
||||
|
||||
echo "== Test 4b: Client-Abbruch gibt den Router-Slot frei"
|
||||
command curl -H "Authorization: Bearer $TEST_ROUTER_KEY" -sfN \
|
||||
"$BASE/v1/chat/completions" -H "Content-Type: application/json" \
|
||||
-d '{"model":"qwen-fast","stream":true,"mock_stream_delay":2,"messages":[{"role":"user","content":"Abbruch"}]}' \
|
||||
>/tmp/aborted-stream.txt 2>/dev/null &
|
||||
ABORT_PID=$!
|
||||
sleep 0.4
|
||||
kill "$ABORT_PID" 2>/dev/null || true
|
||||
wait "$ABORT_PID" 2>/dev/null || true
|
||||
for _ in $(seq 1 30); do
|
||||
ACTIVE=$(curl -sf "$BASE/status" | python3 -c 'import json,sys; print(json.load(sys.stdin)["qwen"]["active_chats"])')
|
||||
[[ $ACTIVE == 0 ]] && break
|
||||
sleep 0.1
|
||||
done
|
||||
CODE=$(curl -s -o /tmp/after-abort.json -w "%{http_code}" "$BASE/v1/chat/completions" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"model":"qwen-fast","messages":[{"role":"user","content":"noch frei?"}]}')
|
||||
[[ ${ACTIVE:-1} == 0 && $CODE == 200 ]] \
|
||||
&& ok "abgebrochener Stream gibt Lease frei; Folgerequest erfolgreich" \
|
||||
|| bad "Stream-Abbruch hinterließ active_chats=${ACTIVE:-?}, HTTP $CODE"
|
||||
|
||||
if [[ ${ROUTER_TEST_QUICK:-0} == 1 ]]; then
|
||||
echo
|
||||
echo "== Schnellergebnis: $PASS bestanden, $FAIL fehlgeschlagen =="
|
||||
[[ $FAIL -eq 0 ]]
|
||||
exit
|
||||
fi
|
||||
|
||||
# --- 5. Tool Calls -----------------------------------------------------------------
|
||||
echo "== Test 5: Tool Calls"
|
||||
RESP=$(curl -sf "$BASE/v1/chat/completions" -H "Content-Type: application/json" \
|
||||
|
||||
Reference in New Issue
Block a user