Skip to content

Commit 00858c3

Browse files
authored
On Windows use Triton cache dir per pytest worker (#3041)
Fixes #2777.
1 parent 97ba60e commit 00858c3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

python/test/unit/conftest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,10 @@ def fresh_triton_cache():
2424
except OSError:
2525
# Ignore errors, such as PermissionError, on Windows
2626
pass
27+
28+
29+
def pytest_configure(config):
30+
worker_id = os.getenv("PYTEST_XDIST_WORKER")
31+
# On Windows, use a dedicated Triton cache per pytest worker to avoid PermissionError.
32+
if os.name == "nt" and worker_id:
33+
os.environ["TRITON_CACHE_DIR"] = tempfile.mkdtemp(prefix="triton-")

0 commit comments

Comments
 (0)