summaryrefslogtreecommitdiff
path: root/src/mongo/db/keys_collection_cache_reader_and_updater_test.cpp
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2017-04-26 14:39:55 -0400
committerRandolph Tan <randolph@10gen.com>2017-05-03 10:47:37 -0400
commit1a6c4ecddfa4bb7a7275dc4b1bf5b79222aa4b72 (patch)
tree683414110da9fef4ba13373ffa9a49c087985369 /src/mongo/db/keys_collection_cache_reader_and_updater_test.cpp
parent1c44e48a50fc2cddbcb2d837a000187a1d84e34e (diff)
downloadmongo-1a6c4ecddfa4bb7a7275dc4b1bf5b79222aa4b72.tar.gz
SERVER-28562 Move LogicalTime HMAC computation outside collection lock
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.cpp18
1 files changed, 9 insertions, 9 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 540b4af8898..2639af95ced 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
@@ -66,7 +66,7 @@ TEST_F(CacheUpdaterTest, ShouldCreate2KeysFromEmpty) {
KeysCollectionCacheReaderAndUpdater updater("dummy", Seconds(5));
const LogicalTime currentTime(LogicalTime(Timestamp(100, 2)));
- LogicalClock::get(operationContext())->initClusterTimeFromTrustedSource(currentTime);
+ LogicalClock::get(operationContext())->setClusterTimeFromTrustedSource(currentTime);
{
auto keyStatus = updater.refresh(operationContext());
@@ -99,7 +99,7 @@ TEST_F(CacheUpdaterTest, ShouldPropagateWriteError) {
KeysCollectionCacheReaderAndUpdater updater("dummy", Seconds(5));
const LogicalTime currentTime(LogicalTime(Timestamp(100, 2)));
- LogicalClock::get(operationContext())->initClusterTimeFromTrustedSource(currentTime);
+ LogicalClock::get(operationContext())->setClusterTimeFromTrustedSource(currentTime);
FailPointEnableBlock failWriteBlock("failCollectionInserts");
@@ -111,7 +111,7 @@ TEST_F(CacheUpdaterTest, ShouldCreateAnotherKeyIfOnlyOneKeyExists) {
KeysCollectionCacheReaderAndUpdater updater("dummy", Seconds(5));
LogicalClock::get(operationContext())
- ->initClusterTimeFromTrustedSource(LogicalTime(Timestamp(100, 2)));
+ ->setClusterTimeFromTrustedSource(LogicalTime(Timestamp(100, 2)));
KeysCollectionDocument origKey1(
1, "dummy", TimeProofService::generateRandomKey(), LogicalTime(Timestamp(105, 0)));
@@ -129,7 +129,7 @@ TEST_F(CacheUpdaterTest, ShouldCreateAnotherKeyIfOnlyOneKeyExists) {
ASSERT_EQ(Timestamp(105, 0), key1.getExpiresAt().asTimestamp());
}
- auto currentTime = LogicalClock::get(operationContext())->getClusterTime().getTime();
+ auto currentTime = LogicalClock::get(operationContext())->getClusterTime();
{
auto keyStatus = updater.refresh(operationContext());
@@ -165,7 +165,7 @@ TEST_F(CacheUpdaterTest, ShouldCreateAnotherKeyIfNoValidKeyAfterCurrent) {
KeysCollectionCacheReaderAndUpdater updater("dummy", Seconds(5));
LogicalClock::get(operationContext())
- ->initClusterTimeFromTrustedSource(LogicalTime(Timestamp(108, 2)));
+ ->setClusterTimeFromTrustedSource(LogicalTime(Timestamp(108, 2)));
KeysCollectionDocument origKey1(
1, "dummy", TimeProofService::generateRandomKey(), LogicalTime(Timestamp(105, 0)));
@@ -193,7 +193,7 @@ TEST_F(CacheUpdaterTest, ShouldCreateAnotherKeyIfNoValidKeyAfterCurrent) {
ASSERT_EQ(Timestamp(110, 0), key2.getExpiresAt().asTimestamp());
}
- auto currentTime = LogicalClock::get(operationContext())->getClusterTime().getTime();
+ auto currentTime = LogicalClock::get(operationContext())->getClusterTime();
{
auto keyStatus = updater.refresh(operationContext());
@@ -256,7 +256,7 @@ TEST_F(CacheUpdaterTest, ShouldCreate2KeysIfAllKeysAreExpired) {
KeysCollectionCacheReaderAndUpdater updater("dummy", Seconds(5));
LogicalClock::get(operationContext())
- ->initClusterTimeFromTrustedSource(LogicalTime(Timestamp(120, 2)));
+ ->setClusterTimeFromTrustedSource(LogicalTime(Timestamp(120, 2)));
KeysCollectionDocument origKey1(
1, "dummy", TimeProofService::generateRandomKey(), LogicalTime(Timestamp(105, 0)));
@@ -284,7 +284,7 @@ TEST_F(CacheUpdaterTest, ShouldCreate2KeysIfAllKeysAreExpired) {
ASSERT_EQ(Timestamp(110, 0), key2.getExpiresAt().asTimestamp());
}
- auto currentTime = LogicalClock::get(operationContext())->getClusterTime().getTime();
+ auto currentTime = LogicalClock::get(operationContext())->getClusterTime();
{
auto keyStatus = updater.refresh(operationContext());
@@ -360,7 +360,7 @@ TEST_F(CacheUpdaterTest, ShouldNotCreateNewKeyIfThereAre2UnexpiredKeys) {
KeysCollectionCacheReaderAndUpdater updater("dummy", Seconds(5));
LogicalClock::get(operationContext())
- ->initClusterTimeFromTrustedSource(LogicalTime(Timestamp(100, 2)));
+ ->setClusterTimeFromTrustedSource(LogicalTime(Timestamp(100, 2)));
KeysCollectionDocument origKey1(
1, "dummy", TimeProofService::generateRandomKey(), LogicalTime(Timestamp(105, 0)));