高温氦气物性补全;三通四通能量计算bug修正
This commit is contained in:
1 parent
6fc9afe41d
commit
2b07d996cf
133 files changed
+5230
-253310
No files matched your search
@@ -34,7 +34,10 @@ class NativeCacheStorageTests(unittest.TestCase):
|
||||
path = self.cache / kind / key(number)
|
||||
path.mkdir(parents=True)
|
||||
(path / "artifact").write_bytes(b"x" * size)
|
||||
os.utime(path, ns=(1_000_000_000 + age, 1_000_000_000 + age))
|
||||
# Windows rounds the former 1 ns age differences to the same timestamp,
|
||||
# changing LRU order to key order and bypassing the intended lock clash.
|
||||
timestamp = (1 + age) * 1_000_000_000
|
||||
os.utime(path, ns=(timestamp, timestamp))
|
||||
return path
|
||||
|
||||
def lease(self, number: int, **kwargs):
|
||||
@@ -235,7 +238,9 @@ with acquire_cache_lease(Path(sys.argv[1]), 'models', sys.argv[2], exclusive=Tru
|
||||
self.assertTrue(all(path.stat().st_size == 0 for path in (self.cache / ".locks").iterdir()))
|
||||
colliding = self.entry(128, 60, 1)
|
||||
other = self.entry(1, 60, 2)
|
||||
self.assertLess(colliding.stat().st_mtime_ns, other.stat().st_mtime_ns)
|
||||
self.lease(0)
|
||||
self.assertIsNone(self.lease(128, exclusive=True, blocking=False))
|
||||
report = storage.prune_cache(self.cache, model_limit_bytes=60)
|
||||
self.assertTrue(colliding.exists())
|
||||
self.assertFalse(other.exists())
|
||||
|
||||
Reference in new issue
Block a user