Skip to content

test: isolate Django cache settings between xdist worker groups - #852

Open
OKAN-SOFTWARE wants to merge 4 commits into
jazzband:masterfrom
OKAN-SOFTWARE:fix/xdist-cache-settings-isolation-777
Open

OKAN-SOFTWARE wants to merge 4 commits into
jazzband:masterfrom
OKAN-SOFTWARE:fix/xdist-cache-settings-isolation-777

Conversation

@OKAN-SOFTWARE

@OKAN-SOFTWARE OKAN-SOFTWARE commented Oct 26, 2026 •

Copy link
Copy Markdown

Summary

Fix Django cache settings leakage between parametrized test configurations when running pytest-xdist. Related to #777.

Changes

  • Initialize a stable Django settings module and apply per-test cache configuration using override_settings.
  • Deep-copy cache settings to prevent configuration changes from leaking between tests.
  • Preserve configuration-specific connection factories and herd settings.
  • Initialize the cache client while retaining Django's cache proxy.
  • Correct cache fixture ordering for scan-iteration tests.
  • Account for MessagePack's IntEnum serialization behavior.
  • Skip sorted-set tests only for the unsupported ShardClient backend.
  • Add regression tests covering cache configuration isolation, including Sentinel.

Validation

  • Targeted regression tests with one worker.
  • Full suite with 4 workers: 1,957 passed, 67 skipped.
  • Full suite with 7 workers: 1,957 passed, 67 skipped.
  • Ruff lint and formatting checks passed.
  • Git diff validation passed.
  • pre-commit.ci passed.
  • GitHub Actions CI — awaiting upstream workflow authorization.

The skipped cases include 28 sorted-set tests for the unsupported sharded client; other backends retain their sorted-set coverage.

Related to #777.

@OKAN-SOFTWARE OKAN-SOFTWARE changed the title Fix/xdist cache settings isolation 777 test: isolate Django cache settings between xdist worker groups Oct 26, 2026
@OKAN-SOFTWARE
OKAN-SOFTWARE marked this pull request as ready for review October 30, 2026 09:40

This branch has not been deployed

No deployments
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.

1 participant