Skip to content

Fix test_bad_cache_file and test_delete_cache_file failures in serial mode#356

Draft
Copilot wants to merge 2 commits intotesting-improvementsfrom
copilot/sub-pr-349
Draft

Fix test_bad_cache_file and test_delete_cache_file failures in serial mode#356
Copilot wants to merge 2 commits intotesting-improvementsfrom
copilot/sub-pr-349

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

The isolated_cache_directory autouse fixture was redirecting _global_params.cache_dir to a tmp_path for all pickle-marked tests, including in serial mode. test_bad_cache_file and test_delete_cache_file rely 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 to tmp_path/... while the hardcoded paths still pointed to ~/.cachier/, breaking the race-condition scenarios those tests depend on.

Changes

  • tests/conftest.py: Restrict isolated_cache_directory to 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.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants