Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGireesh Punathil <gpunathi@in.ibm.com>2017-03-06 18:24:07 +0300
committerItalo A. Casas <me@italoacasas.com>2017-03-20 17:37:56 +0300
commit560d8eed9ac0234ad35e724e5ee56cdbdb5818f8 (patch)
tree904b4c4c74f83ab28f31b26698c79808011426e7 /test
parentf9c831f4b1c271e67813dc1e1584378fbcb9ff73 (diff)
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')
-rw-r--r--test/pseudo-tty/no_dropped_stdio.js10
-rw-r--r--test/pseudo-tty/no_interleaved_stdio.js10
-rw-r--r--test/pseudo-tty/pseudo-tty.status3
-rw-r--r--test/pseudo-tty/test-stderr-stdout-handle-sigwinch.js6
4 files changed, 19 insertions, 10 deletions
diff --git a/test/pseudo-tty/no_dropped_stdio.js b/test/pseudo-tty/no_dropped_stdio.js
index b24d234a38b..f7d9625c62b 100644
--- a/test/pseudo-tty/no_dropped_stdio.js
+++ b/test/pseudo-tty/no_dropped_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
@@ -11,5 +11,9 @@ let out = ('o'.repeat(48) + '\n').repeat(20);
// This results in 1025 bytes, just enough to overflow the 1kb OS X TTY buffer.
out += 'o'.repeat(24) + 'O';
-process.stdout.write(out);
-process.exit(0);
+// 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.exit(0);
+}, common.isAix ? 200 : 0);
diff --git a/test/pseudo-tty/no_interleaved_stdio.js b/test/pseudo-tty/no_interleaved_stdio.js
index ff3ed8594a0..ba3989f9387 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);
diff --git a/test/pseudo-tty/pseudo-tty.status b/test/pseudo-tty/pseudo-tty.status
index 50f54de029d..13279019b6b 100644
--- a/test/pseudo-tty/pseudo-tty.status
+++ b/test/pseudo-tty/pseudo-tty.status
@@ -1,8 +1,5 @@
prefix pseudo-tty
[$system==aix]
-# test issue only, covered under https://github.com/nodejs/node/issues/7973
-no_dropped_stdio : SKIP
-no_interleaved_stdio : SKIP
# being investigated under https://github.com/nodejs/node/issues/9728
test-tty-wrap : FAIL, PASS
diff --git a/test/pseudo-tty/test-stderr-stdout-handle-sigwinch.js b/test/pseudo-tty/test-stderr-stdout-handle-sigwinch.js
index f828e92afbe..4d87e15d342 100644
--- a/test/pseudo-tty/test-stderr-stdout-handle-sigwinch.js
+++ b/test/pseudo-tty/test-stderr-stdout-handle-sigwinch.js
@@ -27,4 +27,8 @@ process.stdout._refreshSize = wrap(originalRefreshSizeStdout,
process.stdout,
'calling stdout._refreshSize');
-process.emit('SIGWINCH');
+// In AIX, the child exits even before the python parent
+// can setup the readloop. Provide a reasonable delay.
+setTimeout(function() {
+ process.emit('SIGWINCH');
+}, common.isAix ? 200 : 0);