Skip to content

Commit bb11067

Browse files
committed
added another sleep to trigger atime change
1 parent f1ded7a commit bb11067

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pydra/utils/tests/test_hash.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,13 @@ def test_persistent_hash_cache(cache_path, text_file):
341341
assert len(list(cache_path.iterdir())) == 2
342342

343343

344-
def test_persistent_hash_cache_cleanup(cache_path, text_file):
344+
def test_persistent_hash_cache_cleanup1(cache_path, text_file):
345345
with mock.patch.dict(
346346
os.environ,
347-
{"PYDRA_HASH_CACHE": str(cache_path), "PYDRA_HASH_CACHE_CLEANUP_PERIOD": "-1"},
347+
{
348+
"PYDRA_HASH_CACHE": str(cache_path),
349+
"PYDRA_HASH_CACHE_CLEANUP_PERIOD": "-100",
350+
},
348351
):
349352
persistent_cache = PersistentCache()
350353
hsh = hash_object(text_file, persistent_cache=persistent_cache)
@@ -353,10 +356,11 @@ def test_persistent_hash_cache_cleanup(cache_path, text_file):
353356
assert len(list(cache_path.iterdir())) == 0
354357

355358

356-
def test_persistent_hash_cache_badpath(cache_path, text_file):
357-
persistent_cache = PersistentCache(cache_path, cleanup_period=-1)
359+
def test_persistent_hash_cache_cleanup2(cache_path, text_file):
360+
persistent_cache = PersistentCache(cache_path, cleanup_period=-100)
358361
hsh = hash_object(text_file, persistent_cache=persistent_cache)
359362
assert len(list(cache_path.iterdir())) == 1
363+
time.sleep(2)
360364
persistent_cache.clean_up()
361365
assert len(list(cache_path.iterdir())) == 0
362366

0 commit comments

Comments
 (0)