Skip to content

Conversation

@kingbuzzman
Copy link
Member

@kingbuzzman kingbuzzman commented Jun 5, 2025

There are weird tests in TestLiveServer.test_settings_before/test_settings_restored that requires xdist to not be used. Since they set a global variable, and due to how xdist works, you cannot guarantee the order or the same worker.

I'm in two minds about this... My gut tells me to remove this test.. but I want to first get your opinion.

@kingbuzzman kingbuzzman marked this pull request as ready for review June 5, 2025 23:08
@kingbuzzman kingbuzzman requested review from bluetech and Copilot June 5, 2025 23:08

This comment was marked as outdated.

@kingbuzzman kingbuzzman requested a review from Copilot August 1, 2025 14:30

This comment was marked as outdated.

@kingbuzzman kingbuzzman requested a review from Copilot August 1, 2025 14:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses test reliability issues by conditionally skipping tests that cannot run properly in parallel test environments. The tests in question modify global Django settings and require specific execution order, which is incompatible with pytest-xdist's parallel execution model.

Key changes:

  • Skip problematic tests when pytest-xdist is detected via environment variable
  • Add os import to support the skipif condition
Comments suppressed due to low confidence (2)

tests/test_fixtures.py:447

  • The skip reason message is too brief and doesn't explain why xdist usage is problematic. Consider a more descriptive message like 'Cannot run in parallel - modifies global settings' to help developers understand the constraint.
    @pytest.mark.skipif("PYTEST_XDIST_WORKER" in os.environ, reason="xdist in use")

tests/test_fixtures.py:463

  • The skip reason message is too brief and doesn't explain why xdist usage is problematic. Consider a more descriptive message like 'Cannot run in parallel - depends on global state from previous test' to help developers understand the constraint.
    @pytest.mark.skipif("PYTEST_XDIST_WORKER" in os.environ, reason="xdist in use")

@kingbuzzman kingbuzzman merged commit 55b8cc8 into main Aug 2, 2025
21 checks passed
@kingbuzzman kingbuzzman deleted the dev/xdist-skip branch August 2, 2025 19:53
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