summaryrefslogtreecommitdiff
path: root/src/mongo/db/error_labels_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/error_labels_test.cpp')
-rw-r--r--src/mongo/db/error_labels_test.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mongo/db/error_labels_test.cpp b/src/mongo/db/error_labels_test.cpp
index 2bf321fab1c..8a2545cec10 100644
--- a/src/mongo/db/error_labels_test.cpp
+++ b/src/mongo/db/error_labels_test.cpp
@@ -32,6 +32,8 @@
#include "mongo/db/curop.h"
#include "mongo/db/error_labels.h"
#include "mongo/db/logical_session_id.h"
+#include "mongo/db/pipeline/aggregate_command_gen.h"
+#include "mongo/db/pipeline/aggregation_request_helper.h"
#include "mongo/db/pipeline/lite_parsed_pipeline.h"
#include "mongo/db/service_context_test_fixture.h"
#include "mongo/unittest/unittest.h"
@@ -290,8 +292,8 @@ TEST_F(ErrorLabelBuilderTest, ResumableChangeStreamErrorAppliesToChangeStreamAgg
// is the only factor that determines the success or failure of isResumableChangeStreamError().
auto cmdObj = BSON("aggregate" << nss().coll() << "pipeline"
<< BSON_ARRAY(BSON("$changeStream" << BSONObj())) << "cursor"
- << BSONObj());
- auto aggRequest = uassertStatusOK(AggregationRequest::parseFromBSON(nss(), cmdObj));
+ << BSONObj() << "$db" << nss().db());
+ auto aggRequest = uassertStatusOK(aggregation_request_helper::parseFromBSON(nss(), cmdObj));
ASSERT_TRUE(LiteParsedPipeline(aggRequest).hasChangeStream());
// The label applies to a $changeStream "aggregate" command.
@@ -314,8 +316,8 @@ TEST_F(ErrorLabelBuilderTest, ResumableChangeStreamErrorDoesNotApplyToNonResumab
// is the only factor that determines the success or failure of isResumableChangeStreamError().
auto cmdObj = BSON("aggregate" << nss().coll() << "pipeline"
<< BSON_ARRAY(BSON("$changeStream" << BSONObj())) << "cursor"
- << BSONObj());
- auto aggRequest = uassertStatusOK(AggregationRequest::parseFromBSON(nss(), cmdObj));
+ << BSONObj() << "$db" << nss().db());
+ auto aggRequest = uassertStatusOK(aggregation_request_helper::parseFromBSON(nss(), cmdObj));
ASSERT_TRUE(LiteParsedPipeline(aggRequest).hasChangeStream());
// The label does not apply to a ChangeStreamFatalError error on a $changeStream aggregation.
@@ -338,8 +340,8 @@ TEST_F(ErrorLabelBuilderTest, ResumableChangeStreamErrorDoesNotApplyToNonChangeS
// is the only factor that determines the success or failure of isResumableChangeStreamError().
auto cmdObj =
BSON("aggregate" << nss().coll() << "pipeline" << BSON_ARRAY(BSON("$match" << BSONObj()))
- << "cursor" << BSONObj());
- auto aggRequest = uassertStatusOK(AggregationRequest::parseFromBSON(nss(), cmdObj));
+ << "cursor" << BSONObj() << "$db" << nss().db());
+ auto aggRequest = uassertStatusOK(aggregation_request_helper::parseFromBSON(nss(), cmdObj));
ASSERT_FALSE(LiteParsedPipeline(aggRequest).hasChangeStream());
// The label does not apply to a non-$changeStream "aggregate" command.