summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLingzhi Deng <lingzhi.deng@mongodb.com>2019-11-25 15:14:47 +0000
committerevergreen <evergreen@mongodb.com>2019-11-25 15:14:47 +0000
commit966f24ab6b9fcc097edb78d7de4a37d9a0519b2b (patch)
tree459396dbb57b522b88ea69eca690999158be34d3
parente461d954679f23ae6b465d5fccd8e7afd492f41c (diff)
downloadmongo-966f24ab6b9fcc097edb78d7de4a37d9a0519b2b.tar.gz
SERVER-44788: Use awaitSecondaryNodes in seed_secondary_without_sessions_table.js instead of waitForState
-rw-r--r--jstests/replsets/seed_secondary_without_sessions_table.js4
-rw-r--r--src/mongo/shell/replsettest.js4
2 files changed, 6 insertions, 2 deletions
diff --git a/jstests/replsets/seed_secondary_without_sessions_table.js b/jstests/replsets/seed_secondary_without_sessions_table.js
index 8bf16415907..248b1ec7ad4 100644
--- a/jstests/replsets/seed_secondary_without_sessions_table.js
+++ b/jstests/replsets/seed_secondary_without_sessions_table.js
@@ -149,7 +149,7 @@
seed = rst.restart(seed, {noReplSet: false});
reconnect(seed);
seed.setSlaveOk();
- rst.waitForState(seed, ReplSetTest.State.SECONDARY);
+ rst.awaitSecondaryNodes(ReplSetTest.kDefaultTimeoutMS, [seed]);
assertCollSize(sessionsColl(primary), 2);
assertCollSize(txnColl(primary), 2);
@@ -211,4 +211,4 @@
assertCollSize(txnColl(seed), 2);
rst.stopSet();
-})(); \ No newline at end of file
+})();
diff --git a/src/mongo/shell/replsettest.js b/src/mongo/shell/replsettest.js
index 9dd2e80f3db..dee9b4c75a0 100644
--- a/src/mongo/shell/replsettest.js
+++ b/src/mongo/shell/replsettest.js
@@ -2592,6 +2592,10 @@ var ReplSetTest = function(opts) {
/**
* Wait for a state indicator to go to a particular state or states.
*
+ * Note that this waits for the state as indicated by the primary node. If you want to wait for
+ * a node to actually reach SECONDARY state, as reported by itself, use awaitSecondaryNodes
+ * instead.
+ *
* @param node is a single node or list of nodes, by id or conn
* @param state is a single state or list of states
* @param timeout how long to wait for the state to be reached