pytest icon indicating copy to clipboard operation
pytest copied to clipboard

Since 8.2.0, automatic multiprocessing causes race conditions in my project

Open Schwaneberg opened this issue 9 months ago • 4 comments

I got a project that cannot be tested with parallelism, as it requires exclusive access to some resources. Unfortunately, this also applies during unit testing. This wasn't a problem up to pytest 8.1.2, but it is since 8.2.0. Since 8.2.0, pytest instantly spawns six child processes, which are blocking each other. I couldn't find a switch to turn this off nor could I identify the PR that caused this (yet).

Schwaneberg avatar Apr 30 '24 11:04 Schwaneberg

More context needed

Core pytest doesn't start processes at all

RonnyPfannschmidt avatar Apr 30 '24 13:04 RonnyPfannschmidt

Hello, in our case (I and @pramodk that link the issue above): We have reproducible segfaults with pytest 8.2.0 on our code. Once we set pytest back to 8.1.1 it works again. Running with pytest 8.2.0 with -v or by specifying all files instead of the directory works too (pytest dir/file1.py dir/file2.py instead of pytest dir).

alkino avatar May 01 '24 21:05 alkino

This can be reproduced by running pytest (v8.2.0) on waitress or black

fossdd avatar May 04 '24 14:05 fossdd

This issue is stale because it has the status: needs information label and requested follow-up information was not provided for 14 days.

github-actions[bot] avatar May 19 '24 01:05 github-actions[bot]

This issue was closed because it has the status: needs information label and follow-up information has not been provided for 7 days since being marked as stale.

github-actions[bot] avatar May 26 '24 01:05 github-actions[bot]

I couldn't generate a minimal failing example yet. I'd like to reopen the issue soon.

Am So., 26. Mai 2024 um 03:52 Uhr schrieb github-actions[bot] < @.***>:

This issue was closed because it has the status: needs information label and follow-up information has not been provided for 7 days since being marked as stale.

— Reply to this email directly, view it on GitHub https://github.com/pytest-dev/pytest/issues/12278#issuecomment-2131937125, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIM6TNNZN6BDHC36LPWKA2DZEE56TAVCNFSM6AAAAABHACBRKSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZRHEZTOMJSGU . You are receiving this because you authored the thread.Message ID: @.***>

Schwaneberg avatar May 26 '24 18:05 Schwaneberg

@fossdd What is "this" exactly? As already mentioned, pytest doesn't do any parallelism itself. As for black, it runs pytest 8.2.0 on CI just fine... I also tried running the waitress tests locally with pytest 8.2.1 and they work fine.

Please be more specific - what exactly is happening? Are you sure it's related to this issue at all?

The-Compiler avatar May 26 '24 21:05 The-Compiler