diff options
Diffstat (limited to 'src/mongo/db/repl/abstract_oplog_fetcher_test.cpp')
-rw-r--r-- | src/mongo/db/repl/abstract_oplog_fetcher_test.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/mongo/db/repl/abstract_oplog_fetcher_test.cpp b/src/mongo/db/repl/abstract_oplog_fetcher_test.cpp index 7c35e08ab76..5fe87c8530c 100644 --- a/src/mongo/db/repl/abstract_oplog_fetcher_test.cpp +++ b/src/mongo/db/repl/abstract_oplog_fetcher_test.cpp @@ -27,6 +27,8 @@ * it in the license file. */ +#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kDefault + #include "mongo/platform/basic.h" #include <memory> @@ -35,8 +37,10 @@ #include "mongo/db/repl/abstract_oplog_fetcher_test_fixture.h" #include "mongo/db/repl/oplog_entry.h" #include "mongo/db/repl/task_executor_mock.h" +#include "mongo/logv2/log.h" #include "mongo/unittest/task_executor_proxy.h" #include "mongo/unittest/unittest.h" +#include "mongo/util/log.h" #include "mongo/util/scopeguard.h" namespace { @@ -300,20 +304,20 @@ TEST_F(AbstractOplogFetcherTest, OplogFetcherStopsRestartingFetcherIfRestartLimi ASSERT_OK(oplogFetcher.startup()); - unittest::log() << "processing find request from first fetcher"; + LOGV2(21038, "processing find request from first fetcher"); _assertFindCommandTimestampEquals( ops[0], processNetworkResponse({makeCursorResponse(1, {ops[0], ops[1], ops[2]})}, true)); - unittest::log() << "sending error response to getMore request from first fetcher"; + LOGV2(21039, "sending error response to getMore request from first fetcher"); assertRemoteCommandNameEquals( "getMore", processNetworkResponse({ErrorCodes::CappedPositionLost, "fail 1"}, true)); - unittest::log() << "sending error response to find request from second fetcher"; + LOGV2(21040, "sending error response to find request from second fetcher"); _assertFindCommandTimestampEquals( ops[2], processNetworkResponse({ErrorCodes::IllegalOperation, "fail 2"}, true)); - unittest::log() << "sending error response to find request from third fetcher"; + LOGV2(21041, "sending error response to find request from third fetcher"); _assertFindCommandTimestampEquals( ops[2], processNetworkResponse({ErrorCodes::OperationFailed, "fail 3"}, false)); @@ -335,28 +339,28 @@ TEST_F(AbstractOplogFetcherTest, OplogFetcherResetsRestartCounterOnSuccessfulFet ASSERT_OK(oplogFetcher.startup()); - unittest::log() << "processing find request from first fetcher"; + LOGV2(21042, "processing find request from first fetcher"); _assertFindCommandTimestampEquals( ops[0], processNetworkResponse({makeCursorResponse(1, {ops[0], ops[1], ops[2]})}, true)); - unittest::log() << "sending error response to getMore request from first fetcher"; + LOGV2(21043, "sending error response to getMore request from first fetcher"); assertRemoteCommandNameEquals( "getMore", processNetworkResponse({ErrorCodes::CappedPositionLost, "fail 1"}, true)); - unittest::log() << "processing find request from second fetcher"; + LOGV2(21044, "processing find request from second fetcher"); _assertFindCommandTimestampEquals( ops[2], processNetworkResponse({makeCursorResponse(1, {ops[2], ops[3], ops[4]})}, true)); - unittest::log() << "sending error response to getMore request from second fetcher"; + LOGV2(21045, "sending error response to getMore request from second fetcher"); assertRemoteCommandNameEquals( "getMore", processNetworkResponse({ErrorCodes::IllegalOperation, "fail 2"}, true)); - unittest::log() << "sending error response to find request from third fetcher"; + LOGV2(21046, "sending error response to find request from third fetcher"); _assertFindCommandTimestampEquals( ops[4], processNetworkResponse({ErrorCodes::InternalError, "fail 3"}, true)); - unittest::log() << "sending error response to find request from fourth fetcher"; + LOGV2(21047, "sending error response to find request from fourth fetcher"); _assertFindCommandTimestampEquals( ops[4], processNetworkResponse({ErrorCodes::OperationFailed, "fail 4"}, false)); @@ -406,12 +410,12 @@ TEST_F(AbstractOplogFetcherTest, ASSERT_OK(oplogFetcher.startup()); ASSERT_TRUE(oplogFetcher.isActive()); - unittest::log() << "processing find request from first fetcher"; + LOGV2(21048, "processing find request from first fetcher"); _assertFindCommandTimestampEquals( ops[0], processNetworkResponse({makeCursorResponse(1, {ops[0], ops[1], ops[2]})}, true)); - unittest::log() << "sending error response to getMore request from first fetcher"; + LOGV2(21049, "sending error response to getMore request from first fetcher"); shouldFailSchedule = true; assertRemoteCommandNameEquals( "getMore", processNetworkResponse({ErrorCodes::CappedPositionLost, "dead cursor"}, false)); |