Fix the clock of the usage-limit wait test so it passes at any time of day #773

Merged
lilleman merged 4 commits from item-570 into main 2026-12-01 17:03:19 +01:00
Showing only changes of commit 73c0d59245 - Show all commits
+1 -1
View File
@@ -141,7 +141,7 @@ if os.path.basename(sys.argv[0]) == "loop-claude":
record({"argv": sys.argv[1:]})
pause = time.sleep
time.sleep = lambda seconds: record({"sleep": seconds}) if seconds >= 1 else pause(seconds)
# A test that sets LOOP_TEST_NOW fixes the loop's wall clock at that many seconds since the epoch.
# LOOP_TEST_NOW pins the loop's wall clock to that many seconds since the epoch.
if "LOOP_TEST_NOW" in os.environ:
time.time = lambda: float(os.environ["LOOP_TEST_NOW"])
# The host's own memory doesn't matter: every read finds all of it available.