summaryrefslogtreecommitdiff
path: root/test/pseudo-tty/test-stdout-read.out
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2019-07-08 20:52:37 +0200
committerAnna Henningsen <anna@addaleax.net>2019-07-15 00:12:38 +0200
commit5bed327a34625e7e60ac67970771556093a3d7bf (patch)
tree8b6abc5c96fff5a1b011dac3abbcfb79459173ec /test/pseudo-tty/test-stdout-read.out
parentd0b0230e7dc536a311e0047c127875c17b998468 (diff)
downloadandroid-node-v8-5bed327a34625e7e60ac67970771556093a3d7bf.tar.gz
android-node-v8-5bed327a34625e7e60ac67970771556093a3d7bf.tar.bz2
android-node-v8-5bed327a34625e7e60ac67970771556093a3d7bf.zip
test: fix pty test hangs on aix
Some pty tests persistently hung on the AIX CI buildbots. Fix that by adding a helper script that properly sets up the pty before spawning the script under test. On investigation I discovered that the test runner hung when it tried to close the slave pty's file descriptor, probably due to a bug in AIX's pty implementation. I could reproduce it with a short C program. The test runner also leaked file descriptors to the child process. I couldn't convince python's `subprocess.Popen()` to do what I wanted it to do so I opted to move the logic to a helper script that can do fork/setsid/etc. without having to worry about stomping on state in tools/test.py. In the process I also uncovered some bugs in the pty module of the python distro that ships with macOS 10.14, leading me to reimplement a sizable chunk of the functionality of that module. And last but not least, of course there are differences between ptys on different platforms and the helper script has to paper over that. Of course. Really, this commit took me longer to put together than I care to admit. Caveat emptor: this commit takes the hacky ^D feeding to the slave out of tools/test.py and puts it in the *.in input files. You can also feed other control characters to tests, like ^C or ^Z, simply by inserting them into the corresponding input file. I think that's nice. Fixes: https://github.com/nodejs/build/issues/1820 Fixes: https://github.com/nodejs/node/issues/28489 PR-URL: https://github.com/nodejs/node/pull/28600 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'test/pseudo-tty/test-stdout-read.out')
-rw-r--r--test/pseudo-tty/test-stdout-read.out1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/pseudo-tty/test-stdout-read.out b/test/pseudo-tty/test-stdout-read.out
index 3b7fda223d..e92928d17b 100644
--- a/test/pseudo-tty/test-stdout-read.out
+++ b/test/pseudo-tty/test-stdout-read.out
@@ -1 +1,2 @@
+Hello!
<Buffer 48 65 6c 6c 6f 21 0a>