summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/dispatch_shard_pipeline_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/dispatch_shard_pipeline_test.cpp')
-rw-r--r--src/mongo/db/pipeline/dispatch_shard_pipeline_test.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/mongo/db/pipeline/dispatch_shard_pipeline_test.cpp b/src/mongo/db/pipeline/dispatch_shard_pipeline_test.cpp
index 8c9528e0e09..ebf3d147c8f 100644
--- a/src/mongo/db/pipeline/dispatch_shard_pipeline_test.cpp
+++ b/src/mongo/db/pipeline/dispatch_shard_pipeline_test.cpp
@@ -27,12 +27,10 @@
* it in the license file.
*/
-#include "mongo/platform/basic.h"
-
#include "mongo/db/pipeline/aggregation_request_helper.h"
#include "mongo/db/pipeline/sharded_agg_helpers.h"
#include "mongo/s/query/sharded_agg_test_fixture.h"
-#include "mongo/s/stale_shard_version_helpers.h"
+#include "mongo/s/router.h"
namespace mongo {
namespace {
@@ -196,15 +194,13 @@ TEST_F(DispatchShardPipelineTest, WrappedDispatchDoesRetryOnStaleConfigError) {
const bool hasChangeStream = false;
auto future = launchAsync([&] {
// Shouldn't throw.
- auto results =
- shardVersionRetry(operationContext(),
- Grid::get(getServiceContext())->catalogCache(),
- kTestAggregateNss,
- "dispatch shard pipeline"_sd,
- [&]() {
- return sharded_agg_helpers::dispatchShardPipeline(
- serializedCommand, hasChangeStream, pipeline->clone());
- });
+ sharding::router::CollectionRouter router(getServiceContext(), kTestAggregateNss);
+ auto results = router.route(operationContext(),
+ "dispatch shard pipeline"_sd,
+ [&](OperationContext* opCtx, const ChunkManager& cm) {
+ return sharded_agg_helpers::dispatchShardPipeline(
+ serializedCommand, hasChangeStream, pipeline->clone());
+ });
ASSERT_EQ(results.remoteCursors.size(), 1UL);
ASSERT(!bool(results.splitPipeline));
});
@@ -213,7 +209,7 @@ TEST_F(DispatchShardPipelineTest, WrappedDispatchDoesRetryOnStaleConfigError) {
// namespace, then mock out a successful response.
onCommand([&](const executor::RemoteCommandRequest& request) {
return createErrorCursorResponse(
- Status{ErrorCodes::StaleShardVersion, "Mock error: shard version mismatch"});
+ {ErrorCodes::StaleShardVersion, "Mock error: shard version mismatch"});
});
// Mock the expected config server queries.