Skip to content

test_pyrepl.run_repl timeout is too small #121605

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

Closed
colesbury opened this issue Jul 10, 2024 · 2 comments
Closed

test_pyrepl.run_repl timeout is too small #121605

colesbury opened this issue Jul 10, 2024 · 2 comments
Labels
tests Tests in the Lib/test dir topic-repl Related to the interactive shell

Comments

@colesbury
Copy link
Contributor

colesbury commented Jul 10, 2024

The timeout in run_repl of 0.5 seconds is too small and leads to spurious failures on slow/heavily loaded machines, or when running with sanitizers:

while select.select([master_fd], [], [], 0.5)[0]:

(This is my second attempt at describing the problems I ran into with #121603)

Linked PRs

@colesbury colesbury added tests Tests in the Lib/test dir topic-repl Related to the interactive shell labels Jul 10, 2024
colesbury added a commit to colesbury/cpython that referenced this issue Jul 10, 2024
We also need to close the `slave_fd` earlier so that reading from
`master_fd` won't block forever when the subprocess finishes.
colesbury added a commit to colesbury/cpython that referenced this issue Jul 11, 2024
We also need to close the `slave_fd` earlier so that reading from
`master_fd` won't block forever when the subprocess finishes.
pablogsal pushed a commit that referenced this issue Jul 13, 2024
We also need to close the `slave_fd` earlier so that reading from
`master_fd` won't block forever when the subprocess finishes.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 13, 2024
…21606)

We also need to close the `slave_fd` earlier so that reading from
`master_fd` won't block forever when the subprocess finishes.
(cherry picked from commit abc3aee)

Co-authored-by: Sam Gross <colesbury@gmail.com>
IljaManakov pushed a commit to IljaManakov/cpython that referenced this issue Jul 13, 2024
)

We also need to close the `slave_fd` earlier so that reading from
`master_fd` won't block forever when the subprocess finishes.
colesbury added a commit that referenced this issue Jul 13, 2024
#121702)

We also need to close the `slave_fd` earlier so that reading from
`master_fd` won't block forever when the subprocess finishes.
(cherry picked from commit abc3aee)

Co-authored-by: Sam Gross <colesbury@gmail.com>
@colesbury colesbury reopened this Jul 15, 2024
@colesbury
Copy link
Contributor Author

Ugh, bad news is that this seemed to slow down the refleaks buildbots, but not the normal buildbots. I'm not entirely sure why yet and I haven't reproduced the issue locally:

Before: https://buildbot.python.org/?#/builders/1226/builds/2221 (total: 18 mins, pyrepl not in slowest tests)
After: https://buildbot.python.org/?#/builders/1226/builds/2223 (total: 42 mins, pyrepl takes 30 mins!)

@colesbury
Copy link
Contributor Author

So I think the issue is that on the buildbots, pyrepl isn't available and one of the tests calls exit instead of exit(), so the subprocess doesn't exit until the timeout expires:

sorted(dir())
exit
Python 3.14.0a0 experimental free-threading build (heads/main:82a4dac9f6, Jul 15 2024, 21:19:11) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
warning: can't use pyrepl: setupterm: could not find terminfo database
>>> sorted(dir())
['__annotations__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__pyrepl_interactive_console', '__spec__']
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
>>>

colesbury added a commit to colesbury/cpython that referenced this issue Jul 15, 2024
The fallback repl does not support "exit" without parentheses, so the
test would hang until the timeout expired.
ambv pushed a commit that referenced this issue Jul 15, 2024
The fallback repl does not support "exit" without parentheses, so the
test would hang until the timeout expired.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 15, 2024
…-121820)

The fallback repl does not support "exit" without parentheses, so the
test would hang until the timeout expired.
(cherry picked from commit 4134261)

Co-authored-by: Sam Gross <colesbury@gmail.com>
ambv pushed a commit that referenced this issue Jul 15, 2024
…) (GH-121823)

The fallback repl does not support "exit" without parentheses, so the
test would hang until the timeout expired.
(cherry picked from commit 4134261)

Co-authored-by: Sam Gross <colesbury@gmail.com>
@ambv ambv closed this as completed Jul 15, 2024
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
)

We also need to close the `slave_fd` earlier so that reading from
`master_fd` won't block forever when the subprocess finishes.
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
…-121820)

The fallback repl does not support "exit" without parentheses, so the
test would hang until the timeout expired.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir topic-repl Related to the interactive shell
Projects
None yet
Development

No branches or pull requests

2 participants