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

Increase get_package_properties timeout #13109

Conversation

mwoehlke-kitware
Copy link
Contributor

Description

Some packages may take a very long time to import, which can spuriously trip the timeout in ModuleInspect. To make this less likely, increase the timeout from 5s to 30s.

Test Plan

I could use some help with how to write an appropriate test, as it doesn't seem to obviously match any existing tests (somewhat pep561.test though it's unclear how that handles the test package). I think the general idea is to write a test that simply tries to inspect a test package whose __init__.py looks like:

import time
time.sleep(7)

This works to reproduce the failure by attempting to run stubgen on the above.

An example of this failure occurring "in the wild" can be seen here.

Some packages may take a very long time to import, which can spuriously
trip the timeout in ModuleInspect. To make this less likely, increase
the timeout from 5s to 30s.
@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Seems reasonable. Fine to not have a test for this change (such a test would be slow anyway :-) )

@hauntsaninja hauntsaninja merged commit 7c6faf4 into python:master Jul 13, 2022
@mwoehlke-kitware mwoehlke-kitware deleted the increase-get_package_properties-timeout branch July 13, 2022 20:48
@mwoehlke-kitware
Copy link
Contributor Author

such a test would be slow anyway

True; it would necessarily take >5s. 🙂

Thanks!

mwoehlke-kitware added a commit to mwoehlke-kitware/drake that referenced this pull request Jul 13, 2022
Update mypy, bringing in a patch to increase the timeout before aborting
an attempt to import a module. The default timeout of 5s is not long
enough to import `pydrake` in some configurations.

Also increase the timeout on our `stubgen_test`.

See python/mypy#13109.
mwoehlke-kitware added a commit to mwoehlke-kitware/drake that referenced this pull request Jul 14, 2022
Update mypy, bringing in a patch to increase the timeout before aborting
an attempt to import a module. The default timeout of 5s is not long
enough to import `pydrake` in some configurations.

Also increase the timeout on our `stubgen_test`.

See python/mypy#13109.
jwnimmer-tri pushed a commit to RobotLocomotion/drake that referenced this pull request Jul 14, 2022
Update mypy, bringing in a patch to increase the timeout before aborting
an attempt to import a module. The default timeout of 5s is not long
enough to import `pydrake` in some configurations.

Also increase the timeout on our `stubgen_test`.

See python/mypy#13109.
Gobot1234 pushed a commit to Gobot1234/mypy that referenced this pull request Aug 12, 2022
Some packages may take a very long time to import, which can spuriously
trip the timeout in ModuleInspect. To make this less likely, increase
the timeout from 5s to 30s.
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.

2 participants