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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions source/crud/tests/unified/aggregate-write-readPreference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ initialData:
- { _id: 1, x: 11 }
- { _id: 2, x: 22 }
- { _id: 3, x: 33 }
- collectionName: *collection1Name
databaseName: *database0Name
documents: []

tests:
- description: "Aggregate with $out includes read preference for 5.0+ server"
Expand All @@ -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.

- collectionName: *collection1Name
databaseName: *database0Name
documents:
- { _id: 2, x: 22 }
- { _id: 3, x: 33 }

- description: "Aggregate with $out omits read preference for pre-5.0 server"
runOnRequirements:
Expand All @@ -108,7 +99,6 @@ tests:
$readPreference: { $$exists: false }
readConcern: *readConcern
writeConcern: *writeConcern
outcome: *outcome

- description: "Aggregate with $merge includes read preference for 5.0+ server"
runOnRequirements:
Expand All @@ -131,7 +121,6 @@ tests:
$readPreference: *readPreference
readConcern: *readConcern
writeConcern: *writeConcern
outcome: *outcome

- description: "Aggregate with $merge omits read preference for pre-5.0 server"
runOnRequirements:
Expand All @@ -152,4 +141,3 @@ tests:
$readPreference: { $$exists: false }
readConcern: *readConcern
writeConcern: *writeConcern
outcome: *outcome

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions source/crud/tests/unified/db-aggregate-write-readPreference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ createEntities:
database: *database0
collectionName: &collection0Name coll0

initialData:
- collectionName: *collection0Name
databaseName: *database0Name
documents: []

tests:
- description: "Database-level aggregate with $out includes read preference for 5.0+ server"
runOnRequirements:
Expand All @@ -73,11 +68,6 @@ tests:
$readPreference: *readPreference
readConcern: *readConcern
writeConcern: *writeConcern
outcome: &outcome
- collectionName: *collection0Name
databaseName: *database0Name
documents:
- { _id: 1 }

- description: "Database-level aggregate with $out omits read preference for pre-5.0 server"
runOnRequirements:
Expand All @@ -102,7 +92,6 @@ tests:
$readPreference: { $$exists: false }
readConcern: *readConcern
writeConcern: *writeConcern
outcome: *outcome

- description: "Database-level aggregate with $merge includes read preference for 5.0+ server"
runOnRequirements:
Expand All @@ -127,7 +116,6 @@ tests:
$readPreference: *readPreference
readConcern: *readConcern
writeConcern: *writeConcern
outcome: *outcome

- description: "Database-level aggregate with $merge omits read preference for pre-5.0 server"
runOnRequirements:
Expand All @@ -148,4 +136,3 @@ tests:
$readPreference: { $$exists: false }
readConcern: *readConcern
writeConcern: *writeConcern
outcome: *outcome
Loading