Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

TST: add timeouts for github actions tests and wheel builds. #27899

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

Merged
merged 5 commits into from
Dec 6, 2024

Conversation

ngoldbaum
Copy link
Member

This is an attempt to track down the hang reported in #27872.

pytest-timeout sets a per-test timeout that also prints a C stack trace if it kills a timed out test runner. It looks like a few years ago there were issues using pytest-timeout and pytest-xdist together, but they seem to have been fixed.

I added it to test-requirements.txt since it's a pure-python dependency and should be harmless even if it's not needed. I can also just pip install it in the wheel testing script if that would be preferred.

I'm passing --durations and --timeout for all the wheel builds because it seems useful to me to always have this information and to always timeout if a single test takes longer than 30 minutes. I can also just do it for the free-threaded build if reviewers would prefer only doing it there.

@pytest.mark.skipif(
threading.active_count() > 1,
reason="skipping test that uses fork because there are multiple threads")
@pytest.mark.skipif(
NOGIL_BUILD,
reason="Cannot safely use fork in tests on the free-threaded build")
Copy link
Member Author

Choose a reason for hiding this comment

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

I noticed in this CI run that despite the skip above, CPython was still warning about an unsafe use of fork, so I think it's probably safer to just always skip this test on the free-threaded build.

@charris
Copy link
Member

charris commented Dec 4, 2024

I reran the hanging test today, and it passed. The problem may have been upstream.

@ngoldbaum
Copy link
Member Author

IMO it's worth having these timeouts for heisenbugs and other infrequent hangs. Also --durations to see slow tests if they do complete.

@charris
Copy link
Member

charris commented Dec 4, 2024

IMO it's worth having these timeouts for heisenbugs and other infrequent hangs.

Agree.

@rgommers rgommers added the 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703) label Dec 5, 2024
Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

Looks like a good idea, +1 in principle. Note that the first job I checked was the cp313t smoke test in linux.yml, and pytest-timeout didn't actually show up. If you want it there, please add it in .github/meson_actions/action.yml. If not, please go ahead and merge I'd say.

@ngoldbaum
Copy link
Member Author

Added a 10 minute timeout and --durations=10 to most of the pytest invocations that happen on Github actions. I still think a 30 minute timeout makes sense for the wheel builds because pypy in particular can be very slow.

@ngoldbaum ngoldbaum changed the title TST: add timeouts for wheel builds. TST: add timeouts for github actions tests and wheel builds. Dec 6, 2024
@ngoldbaum
Copy link
Member Author

Awesome, CI is passing. I didn't re-trigger all the wheel builds because I haven't touched them since they passed in 9169099.

@charris
Copy link
Member

charris commented Dec 6, 2024

pypy in particular can be very slow.

Takes close to 90 minutes on windows. Some of the other builds are variable, sometimes verging on 50 minutes.

@ngoldbaum
Copy link
Member Author

Let's pull this in. Please ping me if anyone notices spurious timeouts or if the timeouts prove to be unhelpful.

@ngoldbaum ngoldbaum merged commit f25fc2c into numpy:main Dec 6, 2024
66 checks passed
@charris
Copy link
Member

charris commented Dec 6, 2024

Thanks Nathan, lets give this a shot. We will need to track the nightlies to see if any problems come up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
05 - Testing 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.