diff options
author | Charlie Swanson <charlie.swanson@mongodb.com> | 2018-03-06 15:07:45 -0500 |
---|---|---|
committer | Charlie Swanson <charlie.swanson@mongodb.com> | 2018-03-07 11:49:25 -0500 |
commit | 2286d21ea884edf41622d40b068efc92a443b12a (patch) | |
tree | 4556c4d73e5856c9de2c681f64507db370ae0ef6 /src/mongo/s/query/async_results_merger_test.cpp | |
parent | f8f35a434be37a18b7fe52f11ef87ed622980e83 (diff) | |
download | mongo-2286d21ea884edf41622d40b068efc92a443b12a.tar.gz |
SERVER-33558 Remove readPreference from AsyncResultsMerger
Diffstat (limited to 'src/mongo/s/query/async_results_merger_test.cpp')
-rw-r--r-- | src/mongo/s/query/async_results_merger_test.cpp | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/src/mongo/s/query/async_results_merger_test.cpp b/src/mongo/s/query/async_results_merger_test.cpp index 34e70fc8333..9106a3f1941 100644 --- a/src/mongo/s/query/async_results_merger_test.cpp +++ b/src/mongo/s/query/async_results_merger_test.cpp @@ -115,9 +115,8 @@ protected: void makeCursorFromExistingCursors( std::vector<ClusterClientCursorParams::RemoteCursor> remoteCursors, boost::optional<BSONObj> findCmd = boost::none, - boost::optional<long long> getMoreBatchSize = boost::none, - ReadPreferenceSetting readPref = ReadPreferenceSetting(ReadPreference::PrimaryOnly)) { - _params = stdx::make_unique<ClusterClientCursorParams>(_nss, readPref); + boost::optional<long long> getMoreBatchSize = boost::none) { + _params = stdx::make_unique<ClusterClientCursorParams>(_nss); _params->remotes = std::move(remoteCursors); if (findCmd) { @@ -1273,36 +1272,6 @@ TEST_F(AsyncResultsMergerTest, GetMoreBatchSizes) { ASSERT_TRUE(unittest::assertGet(arm->nextReady()).isEOF()); } -TEST_F(AsyncResultsMergerTest, SendsSecondaryOkAsMetadata) { - std::vector<ClusterClientCursorParams::RemoteCursor> cursors; - cursors.emplace_back(kTestShardIds[0], kTestShardHosts[0], CursorResponse(_nss, 1, {})); - makeCursorFromExistingCursors(std::move(cursors), - boost::none, - boost::none, - ReadPreferenceSetting(ReadPreference::Nearest)); - - ASSERT_FALSE(arm->ready()); - auto readyEvent = unittest::assertGet(arm->nextEvent()); - ASSERT_FALSE(arm->ready()); - - BSONObj cmdRequestMetadata = getNthPendingRequest(0).metadata; - ASSERT(uassertStatusOK(ReadPreferenceSetting::fromContainingBSON(cmdRequestMetadata)) - .canRunOnSecondary()) - << "full metadata: " << cmdRequestMetadata; - - std::vector<CursorResponse> responses; - std::vector<BSONObj> batch1 = {fromjson("{_id: 1}")}; - responses.emplace_back(_nss, CursorId(0), batch1); - scheduleNetworkResponses(std::move(responses), - CursorResponse::ResponseType::SubsequentResponse); - executor()->waitForEvent(readyEvent); - - ASSERT_TRUE(arm->ready()); - ASSERT_BSONOBJ_EQ(fromjson("{_id: 1}"), *unittest::assertGet(arm->nextReady()).getResult()); - ASSERT_TRUE(arm->ready()); - ASSERT_TRUE(unittest::assertGet(arm->nextReady()).isEOF()); -} - TEST_F(AsyncResultsMergerTest, AllowPartialResults) { BSONObj findCmd = fromjson("{find: 'testcoll', allowPartialResults: true}"); std::vector<ClusterClientCursorParams::RemoteCursor> cursors; |