mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-16 06:21:59 +00:00
导入、同步起草撞上剖析、起草任务时,说法按这次要做的事说下一步
复核 R3。导入目录、同步起草撞上剖析任务回 409 profile_busy 时,原话来自 busy_message,结尾固定是「请等这次剖析结束 (或先停止它)再开始新的剖析」;使用者这时是在导入、起草,不是要开始新的剖析,导入对话框原样显示这句。导入撞上起草 任务时同样说「再开始新的起草」(这是改造前就有的,同一类问题一起改了)。 - catalog_profile_jobs.busy_message / ensure_free 加 then(缺省 THEN_PROFILE「再开始新的剖析」,建剖析任务、重试照旧)。 - catalog_jobs.busy_message / sync_busy_message / ensure_draft_free 同样加 then(缺省 THEN_DRAFT「再开始新的起草」); ensure_idle 和 _lane_busy 按这次要做的事(kind)选:导入撞上什么都是「再导入」;同步起草撞上剖析是「再起草」,撞上 起草仍是「再开始新的起草」(和建起草任务同一句话,test_catalog_draft_jobs 钉着这一点,没动那个文件)。 - 导入接口的说明补上撞上剖析任务回 profile_busy。 测试:剖析时导入、同步起草、再建剖析任务三句结尾各自对得上;队被剖析占着时(任务刚好在收尾)同样按这次要做的事说。
This commit is contained in:
@@ -186,11 +186,20 @@ async def test_import_and_sync_draft_are_409_while_profiling(client, make_source
|
||||
job = (await _start(client, sid, ["channels"])).json()["job"]
|
||||
await asyncio.wait_for(gate.entered.wait(), 10)
|
||||
|
||||
# 说法按这次要做的事说下一步:是在导入、起草,不是要开始新的剖析
|
||||
r = await client.post(f"{_base(sid)}/import", json={"content": exported})
|
||||
assert r.status_code == 409 and r.json()["code"] == "profile_busy", r.text
|
||||
assert "正在剖析" in r.json()["detail"]
|
||||
assert "正在剖析" in r.json()["detail"] and r.json()["detail"].endswith("请等这次剖析结束(或先停止它)再导入")
|
||||
r = await client.post(f"{_base(sid)}/draft", json={"tables": ["gates"]})
|
||||
assert r.status_code == 409 and r.json()["code"] == "profile_busy", r.text
|
||||
assert r.json()["detail"].endswith("请等这次剖析结束(或先停止它)再起草")
|
||||
again = await _start(client, sid, ["gates"])
|
||||
assert again.json()["detail"].endswith("请等这次剖析结束(或先停止它)再开始新的剖析")
|
||||
# 库里查过没有任务、队却被剖析占着(任务刚好在收尾)时同样按这次要做的事说
|
||||
row, holder = SimpleNamespace(name="x"), SimpleNamespace(kind="profile")
|
||||
assert str(catalog_jobs._lane_busy(row, holder, "import")).endswith("(或先停止它)再导入")
|
||||
assert str(catalog_jobs._lane_busy(row, holder, "sync_draft")).endswith("(或先停止它)再起草")
|
||||
assert str(catalog_jobs._lane_busy(row, SimpleNamespace(kind="draft"), "import")).endswith("(或先停止它)再导入")
|
||||
|
||||
gate.release.set()
|
||||
await catalog_profile_jobs.manager.wait(job["id"], timeout=10)
|
||||
|
||||
Reference in New Issue
Block a user