summaryrefslogtreecommitdiff
path: root/test/pseudo-tty/testcfg.py
AgeCommit message (Collapse)Author
2019-07-15test: fix pty test hangs on aixBen Noordhuis
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>
2019-04-19test: do not strip left whitespace in pseudo-tty testsRuben Bridgewater
PR-URL: https://github.com/nodejs/node/pull/27244 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2019-04-13tools: python: ignore instead of select flake8 rulesRefael Ackermann
PR-URL: https://github.com/nodejs/node/pull/25614 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-12-11test: prepare test/pseudo-tty/testcfg.py Python 3cclauss
PR-URL: https://github.com/nodejs/node/pull/24887 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-12-06test: prepare test/pseudo-tty/testcfg.py for Python 3cclauss
PR-URL: https://github.com/nodejs/node/pull/24791 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-11-19test: use print() function on both Python 2 and 3cclauss
PR-URL: https://github.com/nodejs/node/pull/24485 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
2018-10-16tools,test: cleanup and dedup codeRefael Ackermann
* Hoist common code to base class (`GetTestStatus`, and the `section` property to `TestConfiguration`) * Replace ListSet with the built in set * Remove ClassifiedTest * Inline PrintReport * How cases_to_run are filtered PR-URL: https://github.com/nodejs/node/pull/23251 Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-10-04tools: allow input for TTY testsAnna Henningsen
Since faking TTY input is not otherwise fake-able, we need support in the test runner for it. PR-URL: https://github.com/nodejs/node/pull/23053 Reviewed-By: James M Snell <jasnell@gmail.com>
2018-07-31tools,test: remove unused config hooksJon Moss
Removes a couple of unused/empty functions inside of `tools/test.py` PR-URL: https://github.com/nodejs/node/pull/22010 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-12-12test: fail for missing output filesAnna Henningsen
Instead of ignoring missing `.out` files for message/pseudo-tty tests, raise an error to indicate that something is not quite right. Ref: https://github.com/nodejs/node/pull/10037 PR-URL: https://github.com/nodejs/node/pull/10150 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2016-09-12test: skip pseudo-tty/no_dropped_stdio testMichael Dawson
We had marked it as flaky but in some failures it hangs and does not seem to timeout, and or is reported as an error. Also add prefix to status file as it was missing. Also fix name of status file in testcfg.py. It was pointing to message.status instead of pseudo-tty.status. PR-URL: https://github.com/nodejs/node/pull/8470 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2016-06-01test: test TTY problems by fakeing a TTY using openptyJeremiah Senkpiel
Many thanks to thefourtheye and addaleax who helped make the python bits of this possible. See https://github.com/nodejs/node/issues/6980 for more info regarding the related TTY issues. Refs: https://github.com/nodejs/node/issues/6456 Refs: https://github.com/nodejs/node/pull/6773 Refs: https://github.com/nodejs/node/pull/6816 PR-URL: https://github.com/nodejs/node/pull/6895 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Anna Henningsen <anna@addaleax.net>