Skip to content

Time out in _get_executable_info #30256

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 1 commit into from
Jul 4, 2025

Conversation

jkseppan
Copy link
Member

@jkseppan jkseppan commented Jul 3, 2025

Time out after 30 seconds. This is used for version queries which
should be very fast, so a 30-second delay would be unusual.

GitHub Actions test runs have been hanging trying to get the
inkscape version when using Python 3.14:

https://github.com/matplotlib/matplotlib/actions/runs/16043158943/job/45268507848#step:13:836

PR summary

PR checklist

@jkseppan jkseppan force-pushed the timeout-get-executable-info branch from e095401 to 38a4c3b Compare July 3, 2025 16:59


@patch('matplotlib.subprocess.check_output')
def test_get_executable_info_timeout(mock_check_output):
Copy link
Member

Choose a reason for hiding this comment

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

You could use monkeypatch here, though I have no preference here.

@jkseppan jkseppan force-pushed the timeout-get-executable-info branch 2 times, most recently from 066ecd9 to 50f6881 Compare July 4, 2025 03:45
@jkseppan jkseppan added this to the v3.10.4 milestone Jul 4, 2025
mock_check_output.side_effect = subprocess.TimeoutExpired(cmd=['mock'], timeout=30)

with pytest.raises(matplotlib.ExecutableNotFoundError, match='Timed out'):
print(matplotlib._get_executable_info.__wrapped__('inkscape'))
Copy link
Contributor

Choose a reason for hiding this comment

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

the print is a bit weird here (even though it will not actually ever run, of course -- it just statically reads weird to me)

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 found it useful when trying to get the patch argument right, but of course it isn't necessary now.

Time out after 30 seconds. This is used for version queries which
should be very fast, so a 30-second delay would be unusual.

GitHub Actions test runs have been hanging trying to get the
inkscape version when using Python 3.14:

https://github.com/matplotlib/matplotlib/actions/runs/16043158943/job/45268507848#step:13:836
@jkseppan jkseppan force-pushed the timeout-get-executable-info branch from 50f6881 to 6a01311 Compare July 4, 2025 07:26
@anntzer anntzer merged commit ede1ebb into matplotlib:main Jul 4, 2025
40 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jul 4, 2025
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.

3 participants