summaryrefslogtreecommitdiff
path: root/src/mongo/db/keys_collection_cache_reader_and_updater_test.cpp
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2017-06-15 18:19:42 -0400
committerJack Mulrow <jack.mulrow@mongodb.com>2017-06-22 10:09:12 -0400
commit0d79ab8b66fcaf06bf5622de580ed5a85c95bc16 (patch)
tree688fa34e05a158020f8f28e8d1891b95d4ddbacb /src/mongo/db/keys_collection_cache_reader_and_updater_test.cpp
parent67d75157ae993359575e5fb567557d82b016877e (diff)
downloadmongo-0d79ab8b66fcaf06bf5622de580ed5a85c95bc16.tar.gz
SERVER-29652 mongos should not gossip logical time until admin.system.keys is created
Diffstat (limited to 'src/mongo/db/keys_collection_cache_reader_and_updater_test.cpp')
-rw-r--r--src/mongo/db/keys_collection_cache_reader_and_updater_test.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mongo/db/keys_collection_cache_reader_and_updater_test.cpp b/src/mongo/db/keys_collection_cache_reader_and_updater_test.cpp
index 91b5cf2915e..03e337175ab 100644
--- a/src/mongo/db/keys_collection_cache_reader_and_updater_test.cpp
+++ b/src/mongo/db/keys_collection_cache_reader_and_updater_test.cpp
@@ -429,4 +429,23 @@ TEST_F(CacheUpdaterTest, ShouldNotCreateNewKeyIfThereAre2UnexpiredKeys) {
}
}
+TEST_F(CacheUpdaterTest, ShouldNotCreateKeysWithDisableKeyGenerationFailPoint) {
+ auto catalogClient = Grid::get(operationContext())->catalogClient(operationContext());
+ KeysCollectionCacheReaderAndUpdater updater("dummy", catalogClient, Seconds(5));
+
+ const LogicalTime currentTime(LogicalTime(Timestamp(100, 0)));
+ LogicalClock::get(operationContext())->setClusterTimeFromTrustedSource(currentTime);
+
+ {
+ FailPointEnableBlock failKeyGenerationBlock("disableKeyGeneration");
+
+ auto keyStatus = updater.refresh(operationContext());
+ ASSERT_EQ(ErrorCodes::FailPointEnabled, keyStatus.getStatus());
+ }
+
+ auto allKeys = getKeys(operationContext());
+
+ ASSERT_EQ(0U, allKeys.size());
+}
+
} // namespace mongo