summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/dbtests')
-rw-r--r--src/mongo/dbtests/replica_set_tests.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/dbtests/replica_set_tests.cpp b/src/mongo/dbtests/replica_set_tests.cpp
index b04f4f066f6..34d8145606d 100644
--- a/src/mongo/dbtests/replica_set_tests.cpp
+++ b/src/mongo/dbtests/replica_set_tests.cpp
@@ -96,6 +96,8 @@ private:
TEST_F(ReplicaSetTest, ReplCoordExternalStateStoresLastVoteWithNewTerm) {
auto opCtx = makeOpCtx();
+ // Methods that do writes as part of elections expect Flow Control to be disabled.
+ opCtx->setShouldParticipateInFlowControl(false);
auto replCoordExternalState = getReplCoordExternalState();
replCoordExternalState->storeLocalLastVoteDocument(opCtx.get(), repl::LastVote{2, 1})
@@ -117,6 +119,8 @@ TEST_F(ReplicaSetTest, ReplCoordExternalStateStoresLastVoteWithNewTerm) {
TEST_F(ReplicaSetTest, ReplCoordExternalStateDoesNotStoreLastVoteWithOldTerm) {
auto opCtx = makeOpCtx();
+ // Methods that do writes as part of elections expect Flow Control to be disabled.
+ opCtx->setShouldParticipateInFlowControl(false);
auto replCoordExternalState = getReplCoordExternalState();
replCoordExternalState->storeLocalLastVoteDocument(opCtx.get(), repl::LastVote{2, 1})
@@ -138,6 +142,8 @@ TEST_F(ReplicaSetTest, ReplCoordExternalStateDoesNotStoreLastVoteWithOldTerm) {
TEST_F(ReplicaSetTest, ReplCoordExternalStateDoesNotStoreLastVoteWithEqualTerm) {
auto opCtx = makeOpCtx();
+ // Methods that do writes as part of elections expect Flow Control to be disabled.
+ opCtx->setShouldParticipateInFlowControl(false);
auto replCoordExternalState = getReplCoordExternalState();
replCoordExternalState->storeLocalLastVoteDocument(opCtx.get(), repl::LastVote{2, 1})