summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/launcher_test.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthrough/launcher_test.js')
-rw-r--r--jstests/noPassthrough/launcher_test.js43
1 files changed, 21 insertions, 22 deletions
diff --git a/jstests/noPassthrough/launcher_test.js b/jstests/noPassthrough/launcher_test.js
index a4d00ae19f7..a9fc9384c4b 100644
--- a/jstests/noPassthrough/launcher_test.js
+++ b/jstests/noPassthrough/launcher_test.js
@@ -1,32 +1,31 @@
// Note: This test cannot be run in parallel because all output from child processes of the same
// shell is multiplexed to the same buffer.
(function() {
- "use strict";
+"use strict";
- // Note: the windows command line length limit is 8191 characters, so keep this string length
- // under that.
- const numLines = 300;
- const lineContents = "lots of super fun text\n".repeat(numLines).trim();
+// Note: the windows command line length limit is 8191 characters, so keep this string length
+// under that.
+const numLines = 300;
+const lineContents = "lots of super fun text\n".repeat(numLines).trim();
- var echoTest = function() {
- clearRawMongoProgramOutput();
+var echoTest = function() {
+ clearRawMongoProgramOutput();
- // This will produce `numLines` + 1 lines of output because echo isn't being called with
- // `-n`. This will block until the program exits.
- var exitCode = runProgram("echo", lineContents);
- var output = rawMongoProgramOutput();
+ // This will produce `numLines` + 1 lines of output because echo isn't being called with
+ // `-n`. This will block until the program exits.
+ var exitCode = runProgram("echo", lineContents);
+ var output = rawMongoProgramOutput();
- assert.eq(0, exitCode);
+ assert.eq(0, exitCode);
- assert.eq(numLines,
- output.split('\n').length - 1,
- "didn't wait for program's output buffer to finish being consumed");
- };
-
- // The motivating failure for the test was a race in runProgram. Empirically, 10 runs has always
- // been sufficient for this to fail. 16 gives the test some leeway.
- for (var i = 0; i < 16; i++) {
- echoTest();
- }
+ assert.eq(numLines,
+ output.split('\n').length - 1,
+ "didn't wait for program's output buffer to finish being consumed");
+};
+// The motivating failure for the test was a race in runProgram. Empirically, 10 runs has always
+// been sufficient for this to fail. 16 gives the test some leeway.
+for (var i = 0; i < 16; i++) {
+ echoTest();
+}
})();