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

DRIVERS-2914: Don't create output collection in aggregate tests #1660

Merged
merged 2 commits into from
Sep 23, 2024

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Sep 17, 2024

This PR fixes errors when running the aggregate-write-readPreference tests on MongoDB 8.0. The error can be avoided by not creating the output collection during test setup. In addition, I removed the outcome assertions as the tests were flaky on sharded clusters; sometimes the query run to validate the outcome would yield no results, while they were available a split-second later. Tests were run using PHP, and I'd like @comandeo-mongo to confirm the changes fix the failures that Ruby is experiencing.

Please complete the following before merging:

  • Update changelog.
  • Make sure there are generated JSON files from the YAML test files.
  • Test changes in at least one language driver.
  • Test these changes against all server versions and topologies (including standalone, replica set, sharded
    clusters, and serverless).

@alcaeus alcaeus requested a review from a team as a code owner September 17, 2024 10:47
@alcaeus alcaeus requested review from nbbeeken and removed request for a team September 17, 2024 10:47
@jyemin jyemin removed their request for review September 17, 2024 20:09
Copy link
Contributor

@comandeo-mongo comandeo-mongo left a comment

Choose a reason for hiding this comment

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

LGTM, with the Ruby driver updated tests pass on 8.0 without errors - https://spruce.mongodb.com/version/66eab322e30a8a0007f1b4b8/tasks

@@ -78,12 +75,6 @@ tests:
$readPreference: *readPreference
readConcern: *readConcern
writeConcern: *writeConcern
outcome: &outcome
Copy link
Member

Choose a reason for hiding this comment

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

Was it also necessary to remove the outcome assertions? I didn't see that mentioned in DRIVERS-2914 (only initialData), and you didn't remove this assertion from db-aggregate-write-readPreference.yml below.

I'll concede that this isn't essential to the test. The commandStartedEvent assertions for $readPreference is the most relevant bit.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've ran into issues where the outcome assertion failed with no documents being found, but they were there when I checked. Step-debugging and introducing a tiny delay fixed the issue, so I decided to remove that element of flakiness from the test, as the real test is the assertion for $readPreference, and we're testing server behaviour beyond that.

Not removing the assertion from db-aggregate-write-readPreference was an oversight and I've now removed it from that test as well for consistency.

Copy link
Contributor

@nbbeeken nbbeeken left a comment

Choose a reason for hiding this comment

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

LGTM (test pass locally on node!)

@alcaeus alcaeus merged commit 30b3a75 into mongodb:master Sep 23, 2024
4 checks passed
@alcaeus alcaeus deleted the drivers-2914-fix-8.0-errors branch September 23, 2024 13:50
alcaeus pushed a commit that referenced this pull request Sep 24, 2024
isabelatkinson pushed a commit to isabelatkinson/specifications that referenced this pull request Sep 25, 2024
…odb#1660)

* DRIVERS-2914: Don't create output collection in aggregate tests

* Remove outcome assertion
isabelatkinson pushed a commit to isabelatkinson/specifications that referenced this pull request Sep 25, 2024
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.

4 participants