Skip to content

Commit 6645432

Browse files
committed
tests: ignore __pycache__ directory when finding input files
This should fix a race condition seen in CI.
1 parent 9b3f0d3 commit 6645432

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/common.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ def random_input_data():
149149
return _source_files
150150

151151
for root, dirs, files in os.walk(os.path.dirname(__file__)):
152-
dirs[:] = list(sorted(dirs))
152+
# We filter out __pycache__ because there is a race between another
153+
# process writing cache files and us reading them.
154+
dirs[:] = list(sorted(d for d in dirs if d != '__pycache__'))
153155
for f in sorted(files):
154156
try:
155157
with open(os.path.join(root, f), "rb") as fh:

0 commit comments

Comments
 (0)