Skip to content

Commit 0bc05af

Browse files
raballewclaude
andcommitted
fix(test): isolate uv cache per package to prevent parallel race
Parallel make test targets share a single UV cache directory, causing rename collisions on macOS (os error 66) when multiple uv processes write simultaneously. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6f79d7b commit 0bc05af

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

python/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,7 @@ cython_debug/
169169

170170
# Ruff cache
171171
.ruff_cache/
172+
173+
# Per-package uv cache (parallel test isolation)
174+
.uv-cache/
172175
mitmproxy-ca-cert.pem

python/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ pkg-test-%: packages/%
8585
@mkdir -p $(LOGS_DIR)
8686
@rm -f $(LOGS_DIR)/$*.failed
8787
@bash -c 'set -o pipefail; \
88-
PYTHONUNBUFFERED=1 uv run --isolated --directory $< pytest 2>&1 | tee $(LOGS_DIR)/$*.log; \
88+
UV_CACHE_DIR="$(CURDIR)/.uv-cache/$*" PYTHONUNBUFFERED=1 uv run --isolated --directory $< pytest 2>&1 | tee $(LOGS_DIR)/$*.log; \
8989
rc=$$?; \
9090
if [ $$rc -ne 0 ] && [ $$rc -ne 5 ]; then \
9191
touch $(LOGS_DIR)/$*.failed; \
9292
fi; \
9393
true'
9494
else
9595
pkg-test-%: packages/%
96-
uv run --isolated --directory $< pytest || [ $$? -eq 5 ]
96+
UV_CACHE_DIR="$(CURDIR)/.uv-cache/$*" uv run --isolated --directory $< pytest || [ $$? -eq 5 ]
9797
endif
9898

9999
pkg-ty-%: packages/%
@@ -147,6 +147,7 @@ clean-test:
147147
-rm -f .coverage
148148
-rm -f coverage.xml
149149
-rm -rf htmlcov
150+
-rm -rf .uv-cache
150151

151152
clean-docs:
152153
uv run --isolated --all-packages --group docs $(MAKE) -C docs clean

0 commit comments

Comments
 (0)