summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorJonathan Reams <jbreams@mongodb.com>2019-07-24 12:05:25 -0400
committerJonathan Reams <jbreams@mongodb.com>2019-07-26 10:28:46 -0400
commitd24b2849eb28c7b5811a474be868c8538f1c1a88 (patch)
tree8f93bf828e34c74e6039c9128d81d384397bfbf5 /jstests
parent0f996060bda135c287ba6ecfeb386cec1f1ca5e4 (diff)
downloadmongo-d24b2849eb28c7b5811a474be868c8538f1c1a88.tar.gz
SERVER-42378 Validate python environment before config expansion timeout test
Diffstat (limited to 'jstests')
-rw-r--r--jstests/libs/python.js12
-rw-r--r--jstests/noPassthrough/configExpand_exec_timeeout.js2
2 files changed, 12 insertions, 2 deletions
diff --git a/jstests/libs/python.js b/jstests/libs/python.js
index 91a54252966..f046d4df30c 100644
--- a/jstests/libs/python.js
+++ b/jstests/libs/python.js
@@ -14,6 +14,14 @@ function getPython3Binary() {
}
}
- assert(fileExists(cmd), "Python3 interpreter not found");
- return cmd;
+ if (fileExists(cmd)) {
+ return cmd;
+ }
+
+ clearRawMongoProgramOutput();
+ assert.eq(runNonMongoProgram("python", "--version"), 0);
+ const pythonVersion = rawMongoProgramOutput();
+ assert(/Python 3/.exec(pythonVersion));
+
+ return "python";
}
diff --git a/jstests/noPassthrough/configExpand_exec_timeeout.js b/jstests/noPassthrough/configExpand_exec_timeeout.js
index 7434790fc3f..1a20d6fbc63 100644
--- a/jstests/noPassthrough/configExpand_exec_timeeout.js
+++ b/jstests/noPassthrough/configExpand_exec_timeeout.js
@@ -5,6 +5,8 @@
load('jstests/noPassthrough/libs/configExpand/lib.js');
+ assert.eq(runNonMongoProgram.apply(null, makeReflectionCmd('12345', {sleep: 0}).split(" ")), 0);
+
// Sleep 10 seconds during request.
configExpandSuccess({
setParameter: {