summaryrefslogtreecommitdiff
path: root/src/mongo/db/free_mon
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2019-05-07 13:32:34 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2019-05-07 13:32:34 -0400
commitef53c85ff0d5f19d82a240f54f2cbc22fa8687b4 (patch)
treec2060f877d41ced85f9c8edf5b5934d6de57d0c7 /src/mongo/db/free_mon
parentab689c15777a5c2f7d35f602d125fdc7f2fb344c (diff)
downloadmongo-ef53c85ff0d5f19d82a240f54f2cbc22fa8687b4.tar.gz
SERVER-40735 Force FreeMonControllerTest::TestRegisterFail to use fake time
Diffstat (limited to 'src/mongo/db/free_mon')
-rw-r--r--src/mongo/db/free_mon/free_mon_controller_test.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mongo/db/free_mon/free_mon_controller_test.cpp b/src/mongo/db/free_mon/free_mon_controller_test.cpp
index 892fbb7afa2..6892cd034b4 100644
--- a/src/mongo/db/free_mon/free_mon_controller_test.cpp
+++ b/src/mongo/db/free_mon/free_mon_controller_test.cpp
@@ -971,18 +971,19 @@ TEST_F(FreeMonControllerTest, TestRegisterTimeout) {
ASSERT_GTE(controller.registerCollector->count(), 2UL);
}
-// Negatve: Test Register times out if the registration is wrong
+// Negatve: Test Register fails if the registration is wrong
TEST_F(FreeMonControllerTest, TestRegisterFail) {
FreeMonNetworkInterfaceMock::Options opts;
opts.invalidRegister = true;
- ControllerHolder controller(_mockThreadPool.get(), opts, false);
+ ControllerHolder controller(_mockThreadPool.get(), opts);
controller.start(RegistrationType::DoNotRegister);
- auto optionalStatus = controller->registerServerCommand(Seconds(15));
+ auto optionalStatus = controller->registerServerCommand(Milliseconds::min());
ASSERT(optionalStatus);
- ASSERT_NOT_OK(*optionalStatus);
+ ASSERT_OK(*optionalStatus);
+ controller->turnCrankForTest(Turner().registerCommand(1));
ASSERT_TRUE(FreeMonStorage::read(_opCtx.get()).get().getState() == StorageStateEnum::disabled);
ASSERT_EQ(controller.network->getRegistersCalls(), 1);