Fix test_bad_cache_file and test_delete_cache_file failures in serial mode#356
Draft
Copilot wants to merge 2 commits intotesting-improvementsfrom
Draft
Fix test_bad_cache_file and test_delete_cache_file failures in serial mode#356Copilot wants to merge 2 commits intotesting-improvementsfrom
Copilot wants to merge 2 commits intotesting-improvementsfrom
Conversation
Co-authored-by: shaypal5 <917954+shaypal5@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix precommit-ci errors in parallel testing
Fix test_bad_cache_file and test_delete_cache_file failures in serial mode
Feb 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
isolated_cache_directoryautouse fixture was redirecting_global_params.cache_dirto atmp_pathfor allpickle-marked tests, including in serial mode.test_bad_cache_fileandtest_delete_cache_filerely on module-level constants (EXPANDED_CACHIER_DIR,_BAD_CACHE_FPATHS,_DEL_CACHE_FPATHS) that capture the cache dir at import time. After the fixture patched the global config, cachier wrote cache files totmp_path/...while the hardcoded paths still pointed to~/.cachier/, breaking the race-condition scenarios those tests depend on.Changes
tests/conftest.py: Restrictisolated_cache_directoryto only activate when running under a real xdist worker (worker_id != "master"). Serial runs continue using~/.cachier/unchanged, preserving existing test behavior; parallel runs still get per-worker isolated directories.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.