v2.0.1:修复推理型模型(Qwen3/DeepSeek reasoning_content)误报未收到输出+连接测试按连通判定+采样失败不中断+流式超时放宽60s/300s

This commit is contained in:
2026-08-23 18:49:09 +08:00
parent 87b836b52a
commit 5de118a7b5
6 changed files with 55 additions and 22 deletions
+16 -3
View File
@@ -21,6 +21,7 @@ class TestRunner(threading.Thread):
self.start_wall = time.time()
self.ratio = None
self.samples = []
self.last_error = None
def request_cancel(self):
self.cancel_flag = True
@@ -97,14 +98,26 @@ class TestRunner(threading.Thread):
except StopRequested:
raise
except ProviderError as e:
# 单次采样失败:记录并继续后续采样,不让整个测试中断
self.last_error = str(e)
self.log("ERROR", "[%d tok] 采样 %d/%d 失败: %s" % (L, i, n, e))
self.samples.append({"run_index": i, "context_length": L, "ok": False, "error": str(e)})
db.add_run(self.test_id, i, {}, str(e), context_length=L)
raise e
summary = self._make_summary()
db.update_status(self.test_id, "done", summary=summary)
self.log("INFO", "═══ 测试完成 ═══")
ok_count = summary.get("samples_ok") or 0
fail_count = summary.get("samples_total", 0) - ok_count
if ok_count:
db.update_status(self.test_id, "done", summary=summary,
error=("%d 次采样失败:%s" % (fail_count, self.last_error)) if fail_count else "")
self.log("INFO", "═══ 测试完成 ═══")
if fail_count:
self.log("WARN", "%d 次采样失败(最后错误:%s" % (fail_count, self.last_error))
else:
db.update_status(self.test_id, "error", summary=summary,
error=self.last_error or "所有采样均失败")
self.log("ERROR", "所有采样均失败,测试标记为 error(最后错误:%s" % (self.last_error or "未知"))
return
self.log("INFO", "汇总: 平均首字 %.1f ms | 平均预填充 %.1f tok/s | 平均解码 %.1f tok/s"
% (summary.get("avg_ttft_ms") or 0,
summary.get("avg_prefill_speed") or 0,