summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/port_options.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthrough/port_options.js')
-rw-r--r--jstests/noPassthrough/port_options.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/jstests/noPassthrough/port_options.js b/jstests/noPassthrough/port_options.js
index 72fb5bf755d..20cb07e7ede 100644
--- a/jstests/noPassthrough/port_options.js
+++ b/jstests/noPassthrough/port_options.js
@@ -19,10 +19,11 @@ function runTest(bindIP, expectOk) {
// We use assert.soonNoExcept() here because the mongod may not be logging yet.
assert.soonNoExcept(() => {
const logContents = rawMongoProgramOutput();
- const found = logContents.match(/waiting for connections on port (\d+)/);
+ const found =
+ logContents.match(/waiting for connections on port( (\d+)|.*listenerPort":(\d+))/);
if (found !== null) {
print("Found message from mongod with port it is listening on: " + found[0]);
- port = found[1];
+ port = found[2] != undefined ? found[2] : found[3];
return true;
}
});