mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-09-04 02:01:48 +03:00
fix(cron): review follow-ups for system job retirement
- advance the disabled-dream cursor before touching the cron store so the #4242 fix still applies when jobs.json is corrupt - pin the gateway wiring: the disabled-path test now asserts both dream and heartbeat are retired, not just unregistered - cover remove_system_job on a fresh install with no store file
This commit is contained in:
committed by
chengyongru
parent
e5718d4de6
commit
20488a585d
@@ -818,6 +818,15 @@ def test_remove_system_job_retires_persisted_system_job(tmp_path) -> None:
|
||||
assert other.remove_job("dream") == "protected"
|
||||
|
||||
|
||||
def test_remove_system_job_without_store_file(tmp_path) -> None:
|
||||
"""Fresh install with the system job disabled: no jobs.json exists yet."""
|
||||
store_path = tmp_path / "cron" / "jobs.json"
|
||||
service = CronService(store_path)
|
||||
|
||||
assert service.remove_system_job("heartbeat") is False
|
||||
assert not store_path.exists()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_start_server_not_jobs(tmp_path):
|
||||
store_path = tmp_path / "cron" / "jobs.json"
|
||||
|
||||
Reference in New Issue
Block a user