Skip to content

Commit

Permalink
GODRIVER-2315 Further restrict tests that expect errors with capped c…
Browse files Browse the repository at this point in the history
…ollection deletes. (#930)
  • Loading branch information
benjirewis committed May 4, 2022
1 parent f1eef09 commit 497afc9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions mongo/integration/collection_test.go
Expand Up @@ -308,8 +308,8 @@ func TestCollection(t *testing.T) {
assert.Nil(mt, err, "DeleteOne error: %v", err)
assert.Equal(mt, int64(0), res.DeletedCount, "expected DeletedCount 0, got %v", res.DeletedCount)
})
mt.RunOpts("write error", mtest.NewOptions().MaxServerVersion("5.2"), func(mt *mtest.T) {
// Deletes are not allowed on capped collections on MongoDB 5.2-. We use this
mt.RunOpts("write error", mtest.NewOptions().MaxServerVersion("5.0.7"), func(mt *mtest.T) {
// Deletes are not allowed on capped collections on MongoDB 5.0.6-. We use this
// behavior to test the processing of write errors.
cappedOpts := bson.D{{"capped", true}, {"size", 64 * 1024}}
capped := mt.CreateCollection(mtest.Collection{
Expand Down Expand Up @@ -377,8 +377,8 @@ func TestCollection(t *testing.T) {
assert.Nil(mt, err, "DeleteMany error: %v", err)
assert.Equal(mt, int64(0), res.DeletedCount, "expected DeletedCount 0, got %v", res.DeletedCount)
})
mt.RunOpts("write error", mtest.NewOptions().MaxServerVersion("5.2"), func(mt *mtest.T) {
// Deletes are not allowed on capped collections on MongoDB 5.2-. We use this
mt.RunOpts("write error", mtest.NewOptions().MaxServerVersion("5.0.7"), func(mt *mtest.T) {
// Deletes are not allowed on capped collections on MongoDB 5.0.6-. We use this
// behavior to test the processing of write errors.
cappedOpts := bson.D{{"capped", true}, {"size", 64 * 1024}}
capped := mt.CreateCollection(mtest.Collection{
Expand Down Expand Up @@ -1505,8 +1505,8 @@ func TestCollection(t *testing.T) {
})
}
})
mt.RunOpts("delete write errors", mtest.NewOptions().MaxServerVersion("5.2"), func(mt *mtest.T) {
// Deletes are not allowed on capped collections on MongoDB 5.2-. We use this
mt.RunOpts("delete write errors", mtest.NewOptions().MaxServerVersion("5.0.7"), func(mt *mtest.T) {
// Deletes are not allowed on capped collections on MongoDB 5.0.6-. We use this
// behavior to test the processing of write errors.
doc := mongo.NewDeleteOneModel().SetFilter(bson.D{{"x", 1}})
models := []mongo.WriteModel{doc, doc}
Expand Down Expand Up @@ -1604,8 +1604,8 @@ func TestCollection(t *testing.T) {
assert.Equal(mt, expectedModel, actualModel, "expected model %v in BulkWriteException, got %v",
expectedModel, actualModel)
})
mt.RunOpts("unordered writeError index", mtest.NewOptions().MaxServerVersion("5.2"), func(mt *mtest.T) {
// Deletes are not allowed on capped collections on MongoDB 5.2-. We use this
mt.RunOpts("unordered writeError index", mtest.NewOptions().MaxServerVersion("5.0.7"), func(mt *mtest.T) {
// Deletes are not allowed on capped collections on MongoDB 5.0.6-. We use this
// behavior to test the processing of write errors.
cappedOpts := bson.D{{"capped", true}, {"size", 64 * 1024}}
capped := mt.CreateCollection(mtest.Collection{
Expand Down

0 comments on commit 497afc9

Please sign in to comment.