From d94246ad928a55759f4a829f51bb4932c4a334fd Mon Sep 17 00:00:00 2001 From: yu1128-L <2241397554@qq.com> Date: Thu, 8 Oct 2026 09:10:30 +0800 Subject: [PATCH] test: remove Windows clock and path assumptions (#6474) Co-authored-by: yu1128-L <296164533+yu1128-L@users.noreply.github.com> --- backend/tests/test_doctor.py | 2 +- backend/tests/test_scheduled_goal_handoff.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/tests/test_doctor.py b/backend/tests/test_doctor.py index 5d2e9fab64..b7e68e7ad2 100644 --- a/backend/tests/test_doctor.py +++ b/backend/tests/test_doctor.py @@ -1179,4 +1179,4 @@ class TestMainConfigResolution: else: assert exit_code == 1 assert "✗ config.yaml found" in output - assert "~/cfg.yaml" in output + assert str(Path("~/cfg.yaml")) in output diff --git a/backend/tests/test_scheduled_goal_handoff.py b/backend/tests/test_scheduled_goal_handoff.py index f7213427a1..25f3d7c76c 100644 --- a/backend/tests/test_scheduled_goal_handoff.py +++ b/backend/tests/test_scheduled_goal_handoff.py @@ -468,6 +468,11 @@ async def test_scheduled_cleanup_barrier_keeps_lease_renewal_and_remote_cancel_a record = await manager.create_or_reject("result", user_id="alice") record.scheduled_goal_cleanup_pending = True await manager.set_status(record.run_id, RunStatus.success, persist=False) + # Keep the confirmed deadline well inside the 30-second lease window. + # Renewal computes a fresh now+lease value; Windows' coarse clock can + # otherwise make two immediate samples identical and defeat a strict > + # assertion without changing the behavior under test. + record.lease_expires_at = (datetime.now(UTC) + timedelta(seconds=10)).isoformat() original_deadline = record.lease_expires_at await store.request_cancel(record.run_id, action="rollback") await manager._renew_leases()