test: remove Windows clock and path assumptions (#6474)

Co-authored-by: yu1128-L <296164533+yu1128-L@users.noreply.github.com>
This commit is contained in:
yu1128-L 2026-10-08 09:10:30 +08:00 committed by GitHub
parent b58aea3101
commit d94246ad92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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()