From e7ec69666f24faa80f0cae062951e9fd340221d6 Mon Sep 17 00:00:00 2001 From: Samuel Giuseppe Schlesinger Date: Fri, 30 Oct 2026 12:19:46 -0400 Subject: [PATCH] test(cache): isolate measurement fixtures from host free space Mock ample default disk capacity with cleanup for tiny fixture copies. Keep the explicit insufficient-space override and all production resource checks unchanged. Found on a constrained host while validating #1730; tracked separately in #1753. No library, abstract or renderer impact. AI assistance: Codex worker /root/mathlib_cache_retry_1730. --- scripts/test_cache_handoff_measurement.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/test_cache_handoff_measurement.py b/scripts/test_cache_handoff_measurement.py index 0a700ae345..3b3a9e058e 100644 --- a/scripts/test_cache_handoff_measurement.py +++ b/scripts/test_cache_handoff_measurement.py @@ -31,6 +31,12 @@ class Fixture(unittest.TestCase): def setUp(self): self.temp = tempfile.TemporaryDirectory(prefix="handoff-measurement-test-") self.addCleanup(self.temp.cleanup) + # Tiny fixtures do not allocate the production handoff reserve. Simulate capacity; + # the insufficient-space test overrides this default explicitly. + disk = patch.object(study.shutil, "disk_usage", + return_value=shutil._ntuple_diskusage(64 << 30, 0, 64 << 30)) + disk.start() + self.addCleanup(disk.stop) self.base = Path(self.temp.name) self.root, self.cache, self.runner = [self.base / name for name in ("checkout", "cache", "runner")] for path in (self.root, self.cache, self.runner):