Skip to content

MAINT: exit deadlock tests quickly on slow hardware - #32466

Merged
ngoldbaum merged 2 commits into
numpy:mainfrom
ngoldbaum:fix-slow-emulated-test
Sep 1, 2026
Merged

MAINT: exit deadlock tests quickly on slow hardware#32466
ngoldbaum merged 2 commits into
numpy:mainfrom
ngoldbaum:fix-slow-emulated-test

Conversation

@ngoldbaum

Copy link
Copy Markdown
Member

PR summary

See #32461.

@h-vetinari mentioned that he has some tests that use this helper skipped for riscv and ppc on conda-forge because they take longer than 30 seconds and lead to test failures.

Rather than skipping these tests, let's add a second way for these tests to exit if no deadlock happens.

On a fast machine, these tests all pass in less than a second. On a slow machine, we're still testing for deadlocks, but we don't spend 30 seconds chewing on contended memory and instead exit if we're still making forward progress after 2 seconds. We'll never reach the break if there's a deadlock so a real deadlock will still hit the 30s timeout.

AI Disclosure

I used an AI to think about the problem. I implemented the fix.

@ngoldbaum ngoldbaum added 03 - Maintenance 09 - Backport-Candidate PRs tagged should be backported labels Aug 31, 2026

@vividwhisp vividwhisp left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

hey @ngoldbaum i'm new here!
any tips to get started with contributing like in pytests, etc.

@mattip mattip left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. One suggestion, feel free to ignore.

Comment thread numpy/_core/tests/test_multithreading.py Outdated
Co-authored-by: Matti Picus <matti.picus@gmail.com>
@ngoldbaum
ngoldbaum force-pushed the fix-slow-emulated-test branch from d872632 to 73592df Compare September 1, 2026 20:40
@ngoldbaum
ngoldbaum merged commit 843daea into numpy:main Sep 1, 2026
93 of 94 checks passed
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Sep 2, 2026
charris pushed a commit that referenced this pull request Sep 2, 2026
Co-authored-by: Matti Picus <matti.picus@gmail.com>
charris added a commit that referenced this pull request Sep 2, 2026
MAINT: exit deadlock tests quickly on slow hardware (#32466)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants