diff options
author | Gireesh Punathil <gpunathi@in.ibm.com> | 2017-03-06 10:24:07 -0500 |
---|---|---|
committer | Gibson Fahnestock <gibfahn@gmail.com> | 2017-03-17 12:28:44 +0000 |
commit | d631af59c0c4bf0811c7176176bf78f68e9fab6d (patch) | |
tree | ce36a9814536cd95d65299b7e4654a2b6ff23d82 /test/pseudo-tty/no_interleaved_stdio.js | |
parent | d099f8e317a6c55c2c0b877565b47d40c5a3ba9c (diff) | |
download | android-node-v8-d631af59c0c4bf0811c7176176bf78f68e9fab6d.tar.gz android-node-v8-d631af59c0c4bf0811c7176176bf78f68e9fab6d.tar.bz2 android-node-v8-d631af59c0c4bf0811c7176176bf78f68e9fab6d.zip |
test: delay child exit in AIX for pseudo-tty tests
The tests in pseudo-tty takes the form of child node writing some data
and exiting, while parent python consume them through pseudo tty
implementations, and validate the result.
While there is no synchronization between child and parent, this works
for most platforms, except AIX, where the child exits even before the
parent could setup the read loop, under race conditions
Fixing the race condition is ideally done through sending ACK messages
to and forth, but involves massive changes and have side effect. The
workaround is to address them in AIX alone, by adding a reasonable
delay.
PR-URL: https://github.com/nodejs/node/pull/11715
Fixes: https://github.com/nodejs/node/issues/7973
Fixes: https://github.com/nodejs/node/issues/9765
Fixes: https://github.com/nodejs/node/issues/11541
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Diffstat (limited to 'test/pseudo-tty/no_interleaved_stdio.js')
-rw-r--r-- | test/pseudo-tty/no_interleaved_stdio.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/pseudo-tty/no_interleaved_stdio.js b/test/pseudo-tty/no_interleaved_stdio.js index ff3ed8594a..ba3989f938 100644 --- a/test/pseudo-tty/no_interleaved_stdio.js +++ b/test/pseudo-tty/no_interleaved_stdio.js @@ -1,7 +1,7 @@ // https://github.com/nodejs/node/issues/6456#issuecomment-219320599 // https://gist.github.com/isaacs/1495b91ec66b21d30b10572d72ad2cdd 'use strict'; -require('../common'); +const common = require('../common'); // 1000 bytes wrapped at 50 columns // \n turns into a double-byte character @@ -13,5 +13,9 @@ out += 'o'.repeat(24) + 'O'; const err = '__This is some stderr__'; -process.stdout.write(out); -process.stderr.write(err); +// In AIX, the child exits even before the python parent +// can setup the readloop. Provide a reasonable delay. +setTimeout(function() { + process.stdout.write(out); + process.stderr.write(err); +}, common.isAix ? 200 : 0); |