Skip to content

Commit 83e9e61

Browse files
committed
ignore non-deterministic worker stats in test_cache_deeply_nested_a2
Multiprocessing added WORKER * keys to diff.get_stats() output, but those counts vary across runs. Filter them out before comparing to expected_stats so the slow test stays deterministic on 3.14 (the only matrix entry that runs --runslow).
1 parent 8c3873a commit 83e9e61

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/test_cache.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ def test_cache_deeply_nested_a2(self, nested_a_t1, nested_a_t2, nested_a_result)
4646
"MAX PASS LIMIT REACHED": False,
4747
"MAX DIFF LIMIT REACHED": False,
4848
}
49-
assert not DeepDiff(expected_stats, stats, use_log_scale=True)
49+
# Worker-prefixed keys come from multiprocessing and are non-deterministic.
50+
filtered_stats = {k: v for k, v in stats.items() if not k.startswith("WORKER ")}
51+
assert not DeepDiff(expected_stats, filtered_stats, use_log_scale=True)
5052
assert nested_a_result == diff
5153
diff_of_diff = DeepDiff(nested_a_result, diff.to_dict(), ignore_order=False)
5254
assert not diff_of_diff

0 commit comments

Comments
 (0)