Skip to content

test(tier-guard): module-list check counts the xdist probe module while it is on disk #2341

Closed

Description

@JarryShaw

Describe the bug

TestTierTests.test_every_module_resolves_to_exactly_one_tier (tests/test_tier_guard.py) compares _tiers.suite_modules() with a bare TESTS_ROOT.rglob('test_*.py'). suite_modules() excludes the xdist probe module (_tiers.PROBE_MODULE_NAME, tests/protocols/test_zzz_xdist_guard_probe_unit.py). The rglob does not, so the test fails whenever XdistSubprocessTests has the probe on disk at the same moment.

Evidence

On main at bfe184bd6, the Python 3.15 on Windows (experimental) leg of run 40413168147 failed with First differing element 530: 'tests/protocols/transport/test_mptcp_roundtrip_unit.py' / 'tests/protocols/test_zzz_xdist_guard_probe_unit.py'. The experimental: main push runs CI report posted it as a warning.

Expected behavior

The on-disk scan skips what suite_modules() skips: the probe module and __pycache__, through _tiers.is_probe_module. A test creates the probe file and checks that the guard still passes.

Activity

  1. added this to the PyPCAPKit v1.5 milestone on Oct 26, 2026
  2. added
    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)
    testPull requests that add or correct tests (test: subject prefix)
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 26, 2026
  3. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 26, 2026
  4. JarryShaw commented on Oct 26, 2026

    @JarryShaw
    OwnerAuthor

    Fixed on main in 15c2e57 (a test-only push). The module-list check scans the disk through on_disk_test_modules(), which skips the probe exactly as suite_modules() does. A new test writes the probe and checks that the two lists agree; it fails without the fix. tests/test_tier_guard.py and tests/test_tier_guard_xdist.py give 146 passed.

  5. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)testPull requests that add or correct tests (test: subject prefix)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions