diff options
author | Kevin Pulo <kevin.pulo@mongodb.com> | 2020-10-07 11:25:10 +1100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-10-08 09:33:54 +0000 |
commit | b2429fa83457d26135a10a2d70a2c554c61922f7 (patch) | |
tree | 5dbf32e507089af1a703bbad83c29da14bb264b8 | |
parent | ca20029fb08910191b36950dcdf1cde8b394234a (diff) | |
download | mongo-b2429fa83457d26135a10a2d70a2c554c61922f7.tar.gz |
SERVER-51003 split long-running randomized repl unittests into a separate db_repl_idempotency_test binary
-rw-r--r-- | src/mongo/db/repl/SConscript | 13 | ||||
-rw-r--r-- | src/mongo/db/repl/idempotency_test.cpp | 15 | ||||
-rw-r--r-- | src/mongo/db/repl/oplog_applier_impl_test.cpp | 15 |
3 files changed, 27 insertions, 16 deletions
diff --git a/src/mongo/db/repl/SConscript b/src/mongo/db/repl/SConscript index 6230cc6b79e..ac1d4eb5761 100644 --- a/src/mongo/db/repl/SConscript +++ b/src/mongo/db/repl/SConscript @@ -1432,7 +1432,6 @@ env.CppUnitTest( 'check_quorum_for_config_change_test.cpp', 'drop_pending_collection_reaper_test.cpp', 'idempotency_document_structure_test.cpp', - 'idempotency_test.cpp', 'idempotency_update_sequence_test.cpp', 'initial_syncer_test.cpp', 'isself_test.cpp', @@ -1634,6 +1633,18 @@ env.CppUnitTest( ], ) +env.CppUnitTest( + target='db_repl_idempotency_test', + source=[ + 'idempotency_test.cpp', + ], + LIBDEPS=[ + '$BUILD_DIR/mongo/db/update/update_test_helpers', + 'idempotency_test_fixture', + 'idempotency_test_util', + ], +) + env.Library( target='replication_metrics', source=[ diff --git a/src/mongo/db/repl/idempotency_test.cpp b/src/mongo/db/repl/idempotency_test.cpp index 86c707dfacf..9435ec730c6 100644 --- a/src/mongo/db/repl/idempotency_test.cpp +++ b/src/mongo/db/repl/idempotency_test.cpp @@ -319,21 +319,6 @@ TEST_F(RandomizedIdempotencyTest, CheckUpdateSequencesAreIdempotentV2) { runUpdateV2IdempotencyTestCase(0.6); } -TEST_F(IdempotencyTest, UpdateTwoFields) { - ASSERT_OK( - ReplicationCoordinator::get(_opCtx.get())->setFollowerMode(MemberState::RS_RECOVERING)); - - ASSERT_OK(runOpInitialSync(createCollection(kUuid))); - ASSERT_OK(runOpInitialSync(insert(fromjson("{_id: 1, y: [0]}")))); - - auto updateOp1 = update(1, fromjson("{$set: {x: 1}}")); - auto updateOp2 = update(1, fromjson("{$set: {x: 2, 'y.0': 2}}")); - auto updateOp3 = update(1, fromjson("{$set: {y: 3}}")); - - auto ops = {updateOp1, updateOp2, updateOp3}; - testOpsAreIdempotent(ops); -} - } // namespace } // namespace repl } // namespace mongo diff --git a/src/mongo/db/repl/oplog_applier_impl_test.cpp b/src/mongo/db/repl/oplog_applier_impl_test.cpp index 51423127c05..7299f45f0e3 100644 --- a/src/mongo/db/repl/oplog_applier_impl_test.cpp +++ b/src/mongo/db/repl/oplog_applier_impl_test.cpp @@ -3045,6 +3045,21 @@ TEST_F(IdempotencyTest, EmptyCappedNamespaceNotFound) { ASSERT_FALSE(autoColl.getDb()); } +TEST_F(IdempotencyTest, UpdateTwoFields) { + ASSERT_OK( + ReplicationCoordinator::get(_opCtx.get())->setFollowerMode(MemberState::RS_RECOVERING)); + + ASSERT_OK(runOpInitialSync(createCollection(kUuid))); + ASSERT_OK(runOpInitialSync(insert(fromjson("{_id: 1, y: [0]}")))); + + auto updateOp1 = update(1, fromjson("{$set: {x: 1}}")); + auto updateOp2 = update(1, fromjson("{$set: {x: 2, 'y.0': 2}}")); + auto updateOp3 = update(1, fromjson("{$set: {y: 3}}")); + + auto ops = {updateOp1, updateOp2, updateOp3}; + testOpsAreIdempotent(ops); +} + typedef SetSteadyStateConstraints<IdempotencyTest, false> IdempotencyTestDisableSteadyStateConstraints; typedef SetSteadyStateConstraints<IdempotencyTest, true> |