Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle new explain output in tests #1191

Merged
merged 2 commits into from
Sep 11, 2023
Merged

Handle new explain output in tests #1191

merged 2 commits into from
Sep 11, 2023

Conversation

jyemin
Copy link
Collaborator

@jyemin jyemin commented Sep 8, 2023

The response document for the explain command has changed in 7.2 sharded clusters. It introduces a top-level "shards" document that contains the explain output for each shard. This patch supports this new field in tests of explain API in the driver.

JAVA-5137

The response document for the explain command has changed in 7.2 sharded clusters.
It introduces a top-level "shards" document that contains the explain output for
each shard. This patch supports this new field in tests of explain API in the
driver.

JAVA-5137
@jyemin jyemin requested a review from katcharov September 8, 2023 15:27
@jyemin jyemin self-assigned this Sep 8, 2023
Copy link
Contributor

@katcharov katcharov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -99,27 +99,48 @@ public void testExplainOfAggregateWithNewResponseStructure() {
AggregateIterable<BsonDocument> iterable = collection
.aggregate(singletonList(Aggregates.match(Filters.eq("_id", 1))));

Document explainDocument = iterable.explain();
assertNotNull(explainDocument);
Document explainDocument = getAggregateExplainDocument(iterable.explain());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an explanatory comment related to such a structure change at the top of this method, should it be updated / removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. That's not quite the place for it (since it's about skipping the tests) but I added a note above the new helper method instead.

@jyemin jyemin merged commit 90c7062 into mongodb:master Sep 11, 2023
@jyemin jyemin deleted the j5137 branch September 11, 2023 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants