summaryrefslogtreecommitdiff
path: root/src/mongo/s/query/async_results_merger_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/query/async_results_merger_test.cpp')
-rw-r--r--src/mongo/s/query/async_results_merger_test.cpp67
1 files changed, 29 insertions, 38 deletions
diff --git a/src/mongo/s/query/async_results_merger_test.cpp b/src/mongo/s/query/async_results_merger_test.cpp
index 909bdf85d79..575f3cc8509 100644
--- a/src/mongo/s/query/async_results_merger_test.cpp
+++ b/src/mongo/s/query/async_results_merger_test.cpp
@@ -43,7 +43,6 @@
#include "mongo/s/client/shard_registry.h"
#include "mongo/s/query/results_merger_test_fixture.h"
#include "mongo/unittest/death_test.h"
-#include "mongo/unittest/death_test.h"
#include "mongo/unittest/unittest.h"
namespace mongo {
@@ -1324,8 +1323,7 @@ TEST_F(AsyncResultsMergerTest, GetMoreRequestIncludesMaxTimeMS) {
// The next getMore request should include the maxTimeMS.
expectedCmdObj = BSON("getMore" << CursorId(123) << "collection"
<< "testcoll"
- << "maxTimeMS"
- << 789);
+ << "maxTimeMS" << 789);
ASSERT_BSONOBJ_EQ(getNthPendingRequest(0).cmdObj, expectedCmdObj);
// Clean up.
@@ -1346,11 +1344,10 @@ DEATH_TEST_F(AsyncResultsMergerTest,
// Create one cursor whose initial response has a postBatchResumeToken.
auto pbrtFirstCursor = makePostBatchResumeToken(Timestamp(1, 5));
auto firstDocSortKey = makeResumeToken(Timestamp(1, 4), uuid, BSON("_id" << 1));
- auto firstCursorResponse = fromjson(
- str::stream() << "{_id: {clusterTime: {ts: Timestamp(1, 4)}, uuid: '" << uuid.toString()
- << "', documentKey: {_id: 1}}, $sortKey: {'': '"
- << firstDocSortKey.firstElement().String()
- << "'}}");
+ auto firstCursorResponse =
+ fromjson(str::stream() << "{_id: {clusterTime: {ts: Timestamp(1, 4)}, uuid: '"
+ << uuid.toString() << "', documentKey: {_id: 1}}, $sortKey: {'': '"
+ << firstDocSortKey.firstElement().String() << "'}}");
cursors.push_back(makeRemoteCursor(
kTestShardIds[0],
kTestShardHosts[0],
@@ -1380,11 +1377,10 @@ DEATH_TEST_F(AsyncResultsMergerTest,
std::vector<RemoteCursor> cursors;
BSONObj pbrtFirstCursor;
auto firstDocSortKey = makeResumeToken(Timestamp(1, 4), uuid, BSON("_id" << 1));
- auto firstCursorResponse = fromjson(
- str::stream() << "{_id: {clusterTime: {ts: Timestamp(1, 4)}, uuid: '" << uuid.toString()
- << "', documentKey: {_id: 1}}, $sortKey: {'': '"
- << firstDocSortKey.firstElement().String()
- << "'}}");
+ auto firstCursorResponse =
+ fromjson(str::stream() << "{_id: {clusterTime: {ts: Timestamp(1, 4)}, uuid: '"
+ << uuid.toString() << "', documentKey: {_id: 1}}, $sortKey: {'': '"
+ << firstDocSortKey.firstElement().String() << "'}}");
cursors.push_back(makeRemoteCursor(
kTestShardIds[0],
kTestShardHosts[0],
@@ -1409,11 +1405,10 @@ TEST_F(AsyncResultsMergerTest, SortedTailableCursorNotReadyIfRemoteHasLowerPostB
std::vector<RemoteCursor> cursors;
auto pbrtFirstCursor = makePostBatchResumeToken(Timestamp(1, 5));
auto firstDocSortKey = makeResumeToken(Timestamp(1, 4), uuid, BSON("_id" << 1));
- auto firstCursorResponse = fromjson(
- str::stream() << "{_id: {clusterTime: {ts: Timestamp(1, 4)}, uuid: '" << uuid.toString()
- << "', documentKey: {_id: 1}}, $sortKey: {'': '"
- << firstDocSortKey.firstElement().String()
- << "'}}");
+ auto firstCursorResponse =
+ fromjson(str::stream() << "{_id: {clusterTime: {ts: Timestamp(1, 4)}, uuid: '"
+ << uuid.toString() << "', documentKey: {_id: 1}}, $sortKey: {'': '"
+ << firstDocSortKey.firstElement().String() << "'}}");
cursors.push_back(makeRemoteCursor(
kTestShardIds[0],
kTestShardHosts[0],
@@ -1461,11 +1456,10 @@ TEST_F(AsyncResultsMergerTest, SortedTailableCursorNewShardOrderedAfterExisting)
std::vector<CursorResponse> responses;
auto firstDocSortKey = makeResumeToken(Timestamp(1, 4), uuid, BSON("_id" << 1));
auto pbrtFirstCursor = makePostBatchResumeToken(Timestamp(1, 6));
- auto firstCursorResponse = fromjson(
- str::stream() << "{_id: {clusterTime: {ts: Timestamp(1, 4)}, uuid: '" << uuid.toString()
- << "', documentKey: {_id: 1}}, $sortKey: {'': '"
- << firstDocSortKey.firstElement().String()
- << "'}}");
+ auto firstCursorResponse =
+ fromjson(str::stream() << "{_id: {clusterTime: {ts: Timestamp(1, 4)}, uuid: '"
+ << uuid.toString() << "', documentKey: {_id: 1}}, $sortKey: {'': '"
+ << firstDocSortKey.firstElement().String() << "'}}");
std::vector<BSONObj> batch1 = {firstCursorResponse};
auto firstDoc = batch1.front();
responses.emplace_back(kTestNss, CursorId(123), batch1, boost::none, pbrtFirstCursor);
@@ -1491,11 +1485,10 @@ TEST_F(AsyncResultsMergerTest, SortedTailableCursorNewShardOrderedAfterExisting)
responses.clear();
auto secondDocSortKey = makeResumeToken(Timestamp(1, 5), uuid, BSON("_id" << 2));
auto pbrtSecondCursor = makePostBatchResumeToken(Timestamp(1, 6));
- auto secondCursorResponse = fromjson(
- str::stream() << "{_id: {clusterTime: {ts: Timestamp(1, 5)}, uuid: '" << uuid.toString()
- << "', documentKey: {_id: 2}}, $sortKey: {'': '"
- << secondDocSortKey.firstElement().String()
- << "'}}");
+ auto secondCursorResponse =
+ fromjson(str::stream() << "{_id: {clusterTime: {ts: Timestamp(1, 5)}, uuid: '"
+ << uuid.toString() << "', documentKey: {_id: 2}}, $sortKey: {'': '"
+ << secondDocSortKey.firstElement().String() << "'}}");
std::vector<BSONObj> batch2 = {secondCursorResponse};
auto secondDoc = batch2.front();
responses.emplace_back(kTestNss, CursorId(456), batch2, boost::none, pbrtSecondCursor);
@@ -1541,11 +1534,10 @@ TEST_F(AsyncResultsMergerTest, SortedTailableCursorNewShardOrderedBeforeExisting
std::vector<CursorResponse> responses;
auto firstDocSortKey = makeResumeToken(Timestamp(1, 4), uuid, BSON("_id" << 1));
auto pbrtFirstCursor = makePostBatchResumeToken(Timestamp(1, 5));
- auto firstCursorResponse = fromjson(
- str::stream() << "{_id: {clusterTime: {ts: Timestamp(1, 4)}, uuid: '" << uuid.toString()
- << "', documentKey: {_id: 1}}, $sortKey: {'': '"
- << firstDocSortKey.firstElement().String()
- << "'}}");
+ auto firstCursorResponse =
+ fromjson(str::stream() << "{_id: {clusterTime: {ts: Timestamp(1, 4)}, uuid: '"
+ << uuid.toString() << "', documentKey: {_id: 1}}, $sortKey: {'': '"
+ << firstDocSortKey.firstElement().String() << "'}}");
std::vector<BSONObj> batch1 = {firstCursorResponse};
responses.emplace_back(kTestNss, CursorId(123), batch1, boost::none, pbrtFirstCursor);
scheduleNetworkResponses(std::move(responses));
@@ -1570,11 +1562,10 @@ TEST_F(AsyncResultsMergerTest, SortedTailableCursorNewShardOrderedBeforeExisting
responses.clear();
auto secondDocSortKey = makeResumeToken(Timestamp(1, 3), uuid, BSON("_id" << 2));
auto pbrtSecondCursor = makePostBatchResumeToken(Timestamp(1, 5));
- auto secondCursorResponse = fromjson(
- str::stream() << "{_id: {clusterTime: {ts: Timestamp(1, 3)}, uuid: '" << uuid.toString()
- << "', documentKey: {_id: 2}}, $sortKey: {'': '"
- << secondDocSortKey.firstElement().String()
- << "'}}");
+ auto secondCursorResponse =
+ fromjson(str::stream() << "{_id: {clusterTime: {ts: Timestamp(1, 3)}, uuid: '"
+ << uuid.toString() << "', documentKey: {_id: 2}}, $sortKey: {'': '"
+ << secondDocSortKey.firstElement().String() << "'}}");
std::vector<BSONObj> batch2 = {secondCursorResponse};
// The last observed time should still be later than the first shard, so we can get the data
// from it.