-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Make it possible for faulthandler to terminate the pytest process on timeout #13679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first glance this looks nice
There may be some nitpicks but they relate to preexisting patterns
I think I understand why the |
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
True, | ||
marks=pytest.mark.skipif( | ||
"CI" in os.environ, reason="sometimes crashes on CI (#7022)" | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the skip mark to a conditional mark to make it easy to check that this test actually passes locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it be an xfail, then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I tried earlier, but this does not work because xfail_strict = true
is configured in pyproject.toml
and those tests would XPASS
on most CI configurations except ubuntu-py314
that tends to fail for a reason I do not understand as investigated in #13695.
Closes #13678.
This would help projects avoid wasting their precious CI resources when running extensive thread-safety tests (which will become more popular in the new free-threading era).
I also changed the logic to mark the test as XFAIL conditionally on the presence of the "CI" environment variable instead of always skipping (related to #7022). This makes it possible to check that the test pass as expected when running locally.
If you think this is too risky, I can remove the condition and always mark the offending params with the
xfail
mark instead of skipping.EDIT: I will do the later right away because I have already observed such a random failure on the CI: https://github.com/pytest-dev/pytest/actions/runs/17269674978/job/49010727146
EDIT 2: that does not work because
xfail_strict = true
is configured inpyproject.toml
. Let me skip instead...