diff options
author | Rich Trott <rtrott@gmail.com> | 2018-07-15 10:52:36 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-07-15 22:50:16 -0700 |
commit | df97126173918ad589c5ceb234204f66d0c5afac (patch) | |
tree | 47a49e7a1b00dea9b1671d7ab27300bcdd6d48f2 | |
parent | a8ec288884cf2e40e4ff5350ff321e59c9be7088 (diff) | |
download | android-node-v8-df97126173918ad589c5ceb234204f66d0c5afac.tar.gz android-node-v8-df97126173918ad589c5ceb234204f66d0c5afac.tar.bz2 android-node-v8-df97126173918ad589c5ceb234204f66d0c5afac.zip |
test: fix flaky test-debug-prompt
Be sure to send `.exit` only once to avoid spurious EPIPE and possibly
other errors.
Fixes: https://github.com/nodejs/node/issues/21724
PR-URL: https://github.com/nodejs/node/pull/21826
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
-rw-r--r-- | test/sequential/test-debug-prompt.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/sequential/test-debug-prompt.js b/test/sequential/test-debug-prompt.js index 902bce34fc..e32f464690 100644 --- a/test/sequential/test-debug-prompt.js +++ b/test/sequential/test-debug-prompt.js @@ -7,9 +7,12 @@ const spawn = require('child_process').spawn; const proc = spawn(process.execPath, ['inspect', 'foo']); proc.stdout.setEncoding('utf8'); +let needToSendExit = true; let output = ''; proc.stdout.on('data', (data) => { output += data; - if (output.includes('debug> ')) + if (output.includes('debug> ') && needToSendExit) { proc.stdin.write('.exit\n'); + needToSendExit = false; + } }); |