From 1c1c30975a9a01e3c94d6d819981a3ffcba56929 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Mon, 25 Sep 2023 14:21:26 +1000 Subject: [PATCH] added more sleeps to ensure mtimes of input files are different in tests --- pydra/engine/tests/test_specs.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pydra/engine/tests/test_specs.py b/pydra/engine/tests/test_specs.py index 0396c94c91..b68f8c08c2 100644 --- a/pydra/engine/tests/test_specs.py +++ b/pydra/engine/tests/test_specs.py @@ -195,6 +195,7 @@ def test_input_file_hash_2(tmp_path): assert hash1 == hash2 # checking if different content (the same name) affects the hash + time.sleep(2) # ensure mtime is different file_diffcontent = tmp_path / "in_file_1.txt" with open(file_diffcontent, "w") as f: f.write("hi") @@ -225,6 +226,7 @@ def test_input_file_hash_2a(tmp_path): assert hash1 == hash2 # checking if different content (the same name) affects the hash + time.sleep(2) # ensure mtime is different file_diffcontent = tmp_path / "in_file_1.txt" with open(file_diffcontent, "w") as f: f.write("hi") @@ -266,6 +268,7 @@ def test_input_file_hash_3(tmp_path): # assert id(files_hash1["in_file"][filename]) == id(files_hash2["in_file"][filename]) # recreating the file + time.sleep(2) # ensure mtime is different with open(file, "w") as f: f.write("hello") @@ -357,6 +360,7 @@ def test_input_file_hash_5(tmp_path): assert hash1 == hash2 # checking if different content (the same name) affects the hash + time.sleep(2) # ensure mtime is different file_diffcontent = tmp_path / "in_file_1.txt" with open(file_diffcontent, "w") as f: f.write("hi")