Commit 8172e6577 for llama.cpp
commit 8172e6577ac2b35de1ec1e5d1c0aaad6c4a2129f
Author: Pascal <admin@serveurperso.com>
Date: Fri Sep 11 15:50:12 2026 +0200
tests: tolerate a shared pool abort in test_completion_unified (#28759)
The expected success table holds when the four requests enter the shared
pool together. On a loaded runner they are admitted tens of milliseconds
apart, the slot lifetimes overlap differently and the pool overflows
while a short request is still resident. The decode failure aborts every
slot, so a request the table marks as successful comes back with the
context error instead of its generation.
Such a request now passes on that error too, while any other status, a
different error or a truncated generation still fails the test.
diff --git a/tools/server/tests/unit/test_completion.py b/tools/server/tests/unit/test_completion.py
index 9375e0110..01732eb16 100644
--- a/tools/server/tests/unit/test_completion.py
+++ b/tools/server/tests/unit/test_completion.py
@@ -394,7 +394,12 @@ def test_completion_unified(n_ctx, n_slots, n_predict_vals, expected_success):
results = parallel_function_calls(tasks)
for res, n_predict, expect_ok in zip(results, n_predict_vals, expected_success):
if expect_ok:
- assert res.status_code == 200
+ # the pool is aborted as a whole, so a request that fits on its own
+ # is still dropped when the slots overlap, and it says so explicitly
+ assert res.status_code == 200 or (
+ res.status_code == 500
+ and "context size has been exceeded" in res.body["error"]["message"].lower()
+ )
# note: https://github.com/ggml-org/llama.cpp/pull/18700#issuecomment-3728695581
if res.status_code == 200: