Skip to content

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

test(router): wait for upstream job admission before balancing assertions

myhloli8e39a1907482
diff --git a/tests/unittest/test_router_balancing.py b/tests/unittest/test_router_balancing.py
index df0769c8..cd917604 100644
--- a/tests/unittest/test_router_balancing.py
+++ b/tests/unittest/test_router_balancing.py
@@ -126,8 +126,9 @@ def test_cached_tasks_still_balance(tmp_path: Path, monkeypatch: pytest.MonkeyPa
else:
assert task["uploads"] == []
tasks.append(task)
+ # submitted 只表示 Router 开始转发;等待上游实际建好 job,包含仍在排队的任务。
deadline = time.monotonic() + 5
- while not app.state.task_store._records[task["task_id"]].file_states[0].submitted:
+ while sum(len(worker.state.job_store._jobs) for worker in workers.values()) < len(tasks):
assert time.monotonic() < deadline
time.sleep(0.01)
assert [worker.active_jobs for worker in app.state.worker_pool.workers] == [5, 5]