diff options
author | Hana Pearlman <hana.pearlman@mongodb.com> | 2021-08-20 14:04:06 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-08-20 14:48:52 +0000 |
commit | c3af4467a404fffebd8b8584fc8c24160d02e850 (patch) | |
tree | 2bda49bda5870ecf8e70d6d35e1554343442aa4c /src/mongo/dbtests | |
parent | 2d5f7632b30fa6b57992cd6db314ab2a5ca076a6 (diff) | |
download | mongo-c3af4467a404fffebd8b8584fc8c24160d02e850.tar.gz |
SERVER-58586: Improve ClientCursor on mongoD to store and restore theā¦
Diffstat (limited to 'src/mongo/dbtests')
-rw-r--r-- | src/mongo/dbtests/cursor_manager_test.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/dbtests/cursor_manager_test.cpp b/src/mongo/dbtests/cursor_manager_test.cpp index cad5cfe1cfa..ff15eade6e4 100644 --- a/src/mongo/dbtests/cursor_manager_test.cpp +++ b/src/mongo/dbtests/cursor_manager_test.cpp @@ -34,6 +34,7 @@ #include <boost/optional/optional.hpp> #include <boost/optional/optional_io.hpp> +#include "mongo/client/read_preference.h" #include "mongo/db/client.h" #include "mongo/db/clientcursor.h" #include "mongo/db/cursor_manager.h" @@ -103,6 +104,7 @@ public: APIParameters(), opCtx->getWriteConcern(), repl::ReadConcernArgs(repl::ReadConcernLevel::kLocalReadConcern), + ReadPreferenceSetting(ReadPreference::PrimaryOnly), BSONObj(), PrivilegeVector(), }; @@ -154,6 +156,7 @@ TEST_F(CursorManagerTest, ShouldBeAbleToKillPinnedCursor) { APIParameters(), {}, repl::ReadConcernArgs(repl::ReadConcernLevel::kLocalReadConcern), + ReadPreferenceSetting(ReadPreference::PrimaryOnly), BSONObj(), PrivilegeVector()}); @@ -180,6 +183,7 @@ TEST_F(CursorManagerTest, ShouldBeAbleToKillPinnedCursorMultiClient) { APIParameters(), {}, repl::ReadConcernArgs(repl::ReadConcernLevel::kLocalReadConcern), + ReadPreferenceSetting(ReadPreference::PrimaryOnly), BSONObj(), PrivilegeVector()}); @@ -217,6 +221,7 @@ TEST_F(CursorManagerTest, InactiveCursorShouldTimeout) { APIParameters(), {}, repl::ReadConcernArgs(repl::ReadConcernLevel::kLocalReadConcern), + ReadPreferenceSetting(ReadPreference::PrimaryOnly), BSONObj(), PrivilegeVector()}); @@ -233,6 +238,7 @@ TEST_F(CursorManagerTest, InactiveCursorShouldTimeout) { APIParameters(), {}, repl::ReadConcernArgs(repl::ReadConcernLevel::kLocalReadConcern), + ReadPreferenceSetting(ReadPreference::PrimaryOnly), BSONObj(), PrivilegeVector()}); ASSERT_EQ(1UL, cursorManager->timeoutCursors(_opCtx.get(), Date_t::max())); @@ -254,6 +260,7 @@ TEST_F(CursorManagerTest, InactivePinnedCursorShouldNotTimeout) { APIParameters(), {}, repl::ReadConcernArgs(repl::ReadConcernLevel::kLocalReadConcern), + ReadPreferenceSetting(ReadPreference::PrimaryOnly), BSONObj(), PrivilegeVector()}); @@ -279,6 +286,7 @@ TEST_F(CursorManagerTest, MarkedAsKilledCursorsShouldBeDeletedOnCursorPin) { APIParameters(), {}, repl::ReadConcernArgs(repl::ReadConcernLevel::kLocalReadConcern), + ReadPreferenceSetting(ReadPreference::PrimaryOnly), BSONObj(), PrivilegeVector()}); auto cursorId = cursorPin->cursorid(); @@ -313,6 +321,7 @@ TEST_F(CursorManagerTest, InactiveKilledCursorsShouldTimeout) { APIParameters(), {}, repl::ReadConcernArgs(repl::ReadConcernLevel::kLocalReadConcern), + ReadPreferenceSetting(ReadPreference::PrimaryOnly), BSONObj(), PrivilegeVector()}); @@ -346,6 +355,7 @@ TEST_F(CursorManagerTest, UsingACursorShouldUpdateTimeOfLastUse) { APIParameters(), {}, repl::ReadConcernArgs(repl::ReadConcernLevel::kLocalReadConcern), + ReadPreferenceSetting(ReadPreference::PrimaryOnly), BSONObj(), PrivilegeVector()}); auto usedCursorId = cursorPin.getCursor()->cursorid(); @@ -360,6 +370,7 @@ TEST_F(CursorManagerTest, UsingACursorShouldUpdateTimeOfLastUse) { APIParameters(), {}, repl::ReadConcernArgs(repl::ReadConcernLevel::kLocalReadConcern), + ReadPreferenceSetting(ReadPreference::PrimaryOnly), BSONObj(), PrivilegeVector()}); @@ -398,6 +409,7 @@ TEST_F(CursorManagerTest, CursorShouldNotTimeOutUntilIdleForLongEnoughAfterBeing APIParameters(), {}, repl::ReadConcernArgs(repl::ReadConcernLevel::kLocalReadConcern), + ReadPreferenceSetting(ReadPreference::PrimaryOnly), BSONObj(), PrivilegeVector()}); @@ -440,6 +452,7 @@ TEST_F(CursorManagerTest, CursorStoresAPIParameters) { apiParams, {}, repl::ReadConcernArgs(repl::ReadConcernLevel::kLocalReadConcern), + ReadPreferenceSetting(ReadPreference::PrimaryOnly), BSONObj(), PrivilegeVector()}); |