Skip to content
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

TST: always set a (long) timeout for subprocess and always use our wrapper #27726

Merged
merged 3 commits into from
Feb 14, 2024

Conversation

tacaswell
Copy link
Member

If you are using this and really need unbounded timeouts, explicitly pass timeout=None

This is an attempt to avoid azure from hanging and then timing out.

If you are using this and really need unbounded timeouts, explicitly
pass `timeout=None`
@tacaswell tacaswell added this to the v3.9.0 milestone Jan 31, 2024
@tacaswell tacaswell changed the title TST: always set a (long) timeout for subprocess TST: always set a (long) timeout for subprocess and always use our wrapper Jan 31, 2024
@tacaswell
Copy link
Member Author

The second commit finally cleans up all of the subprocess.run, subprocess.call, subprocess.check_output and subprocess.check_call to be run through our helper.

@tacaswell tacaswell force-pushed the tst/finite_tests branch 2 times, most recently from 1bfdf4d to ec90d87 Compare January 31, 2024 22:09
lib/matplotlib/tests/test_backend_nbagg.py Outdated Show resolved Hide resolved
lib/matplotlib/tests/test_backend_webagg.py Outdated Show resolved Hide resolved
lib/matplotlib/tests/test_texmanager.py Outdated Show resolved Hide resolved
lib/matplotlib/tests/test_backend_webagg.py Outdated Show resolved Hide resolved
lib/matplotlib/tests/test_determinism.py Outdated Show resolved Hide resolved
lib/matplotlib/tests/test_font_manager.py Outdated Show resolved Hide resolved
lib/matplotlib/tests/test_font_manager.py Outdated Show resolved Hide resolved
lib/matplotlib/tests/test_matplotlib.py Outdated Show resolved Hide resolved
Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

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

Unfortunately, while subprocess_run_helper defaults to check=True, subprocess_run_for_testing defaults to check=False.

lib/matplotlib/tests/test_backend_nbagg.py Show resolved Hide resolved
lib/matplotlib/tests/test_determinism.py Outdated Show resolved Hide resolved
lib/matplotlib/tests/test_determinism.py Outdated Show resolved Hide resolved
@@ -50,7 +50,7 @@ def setup():
set_reproducibility_for_testing()


def subprocess_run_for_testing(command, env=None, timeout=None, stdout=None,
def subprocess_run_for_testing(command, env=None, timeout=60, stdout=None,
stderr=None, check=False, text=True,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
stderr=None, check=False, text=True,
stderr=None, check=True, text=True,

Since this is used for testing it seems like we should set check=True by default. It looks like you currently set this in many of the calls. Are there even more tests without setting check?

@greglucas greglucas merged commit 27c3dc9 into matplotlib:main Feb 14, 2024
42 checks passed
@tacaswell tacaswell deleted the tst/finite_tests branch February 14, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants