Skip to content

Fix pager test flackiness and add stress tests for echo_via_pager#3499

Open
kdeldycke wants to merge 4 commits into
pallets:stablefrom
kdeldycke:fix-pager-test-race
Open

Fix pager test flackiness and add stress tests for echo_via_pager#3499
kdeldycke wants to merge 4 commits into
pallets:stablefrom
kdeldycke:fix-pager-test-race

Conversation

@kdeldycke
Copy link
Copy Markdown
Collaborator

@kdeldycke kdeldycke commented May 22, 2026

This fix the root cause which was worked around in #3470, and builds on top of #3139.

The thing is: _test_gen_func_fails yields test then raises. Click cannot guarantee that the bytes pushed in the pipe to the pager is delivered before the subprocess dies, as this is under the system authority. So that's why the issue was only uncovered in Python 3.14t, where the scheduling management is not deterministic.

We loose the "yield-then-raise" case, but that case was untestable by file content anyway.

To prevent this issue to re-occur, and to catch it early next time, I made the stress tests a bit more generic to collect all stress Pytest markers. And added a new stress test to detect echo_via_pager leaks.

Together with the b1bc8c9 / #3238 that was already pushed, this PR fully resolves #2899.

@kdeldycke kdeldycke added this to the 8.4.2 milestone May 22, 2026
@kdeldycke kdeldycke added bug f:test runner feature: cli test runner labels May 22, 2026
@kdeldycke kdeldycke force-pushed the fix-pager-test-race branch from 167069a to d4ed88f Compare May 22, 2026 11:40
@kdeldycke
Copy link
Copy Markdown
Collaborator Author

We loose the "yield-then-raise" case, but that case was untestable by file content anyway.

Just found a way to recover that original test intention in: d4ed88f

@kdeldycke
Copy link
Copy Markdown
Collaborator Author

This PR is ready to be reviewed and following my comment at #2899 (comment) , will close #2899

@kdeldycke kdeldycke requested review from Rowlando13 and davidism May 22, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug f:test runner feature: cli test runner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

running tests in parallel with tox p fails

1 participant