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-05-03 13:20:52 -0400
committerRandolph Tan <randolph@10gen.com>2017-05-04 16:29:38 -0400
commit2b3d18c8e9871f7cbb89650133ee694bc28636c2 (patch)
tree0bfed2d46be908e569e724b8cddfbc5f2e1a1b98 /src/mongo/db/keys_collection_cache_reader_and_updater_test.cpp
parent67b8dfc2beb283b08f2549df4d99730325ee5de2 (diff)
downloadmongo-2b3d18c8e9871f7cbb89650133ee694bc28636c2.tar.gz
Revert "Revert "SERVER-28562 Move LogicalTime HMAC computation outside collection lock""
This reverts commit b7c013aa097b2d999ad3f942cdfce130558ef40f.
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)));