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
AIX: test_builtin.test_input_no_stdout_fileno() hangs #84336
Comments
related to Two AIX bots - different environments - continue to fail the test: During the first run - the test fails with something such as: 0:31:47 [215/420] test_abc passed -- running: test_builtin (14 min 10 sec) And in the second pass (re-run of failed tests) the failure goes: test_zip (test.test_builtin.BuiltinTest) ... ok NOTE: the run has stopped with the line test_input_no_stdout_fileno (test.test_builtin.PtyTests) ... and, so the results also fail to get uploaded. |
did not get issue numbers in above: bpo-31160 and bpo-40094. I waited a day, before posting - in the hope it would go away. Also, I have been testing manually (no -j arguments) - and test_builtin passes when run manually. So, becoming hard to dissect and propose a "cure". I have started with: ./python ./Tools/scripts/run_tests.py -j 1 -u all -W --slowest --fail-env-changed --timeout=1200 -j2 and now see the test stalled: 0:39:41 running: test_builtin (5 min 14 sec) |
See also bpo-40140: test_builtin crashes when runned in parallel mode on solaris. |
Now consistently - stalled. aixtools@x064:[/home/aixtools/py39-3.9]git diff if pid == 0:
# Child
+ pid = os.getpid() # get my PID
+ tty = open("/dev/pts/3", "a")
+ tty.write("\nI am child - this is my PID:{}".format(pid))
+ tty.close()
try:
# Make sure we don't get stuck if there's a problem
- signal.alarm(2)
+ # signal.alarm(2)
os.close(r)
with open(w, "w") as wpipe:
child(wpipe)
except:
traceback.print_exc()
finally:
+ tty = open("/dev/pts/3", "a")
+ tty.write("\nI am child - exiting PID:{}".format(pid))
+ tty.close()
# We don't want to return to unittest...
os._exit(0) # Parent
os.close(w)
+ tty = open("/dev/pts/3", "a")
+ tty.write("\nI am parent:{} with child:{}".format(os.getpid(), pid))
+ tty.write("fd:{} input:{}".format(fd, terminal_input))
+ tty.close()
os.write(fd, terminal_input) # Get results from the pipe
with open(r, "r") as rpipe:
lines = []
while True:
+ tty = open("/dev/pts/3", "a")
+ tty.write("\nI am parent:{} with lines:{}".format(os.getpid(), lines))
+ tty.close()
line = rpipe.readline().strip()
if line == "":
# The other end was closed => the child exited
@@ -1895,6 +1909,9 @@ class PtyTests(unittest.TestCase):
+ tty = open("/dev/pts/3", "a")
======== Debug ======== I am child - this is my PID:22544440 |
If I move the close to before the support.waitprocess() call I get: aixtools@x064:[/home/aixtools/py39-3.9]./python -m test test_builtin I am child - this is my PID:22544444 1 test OK. |
I tried moving the child/parent logic blocks and get this as debug output: aixtools@x064:[/home/aixtools/py39-3.9]./python -m test test_builtin I am child - this is my PID:8519822 +++++++ |
Next debug info: I am child - this is my PID:8519830 |
FYI: in child block: calling os.exit(0), rather than os._exit() gives same result. |
To get it to move forward: as it is not solely and AIX thing (see bpo-40-140) This works: but is it what is wanted? Tests result: SUCCESS - # Wait until the child process completes before closing the PTY to
- # prevent sending SIGHUP to the child process.
- support.wait_process(pid, exitcode=0)
+ if sys.platform == "linux" or not os.name == "posix":
+ # Wait until the child process completes before closing the PTY to
+ # prevent sending SIGHUP to the child process.
+ support.wait_process(pid, exitcode=0)
- # Close the PTY
- os.close(fd)
+ # Close the PTY
+ os.close(fd)
+ else:
+ # Other posix need to close the pty for the child to exit normally
+ # Close the PTY
+ os.close(fd)
+ support.wait_process(pid, exitcode=0) |
Michael Felt: Can you please test if PR 19312 fix the issue for you on AIX? |
Thanks for the fix! |
test_builtin
from hanging on AIX, Solaris and maybe others. #19308Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: