Skip to content

Commit 21387b7

Browse files
benjirewisBenjamin Rewis
authored andcommitted
GODRIVER-2315 Further restrict tests that expect errors with capped collection deletes. (#930)
1 parent b74c6cc commit 21387b7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

mongo/integration/collection_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ func TestCollection(t *testing.T) {
308308
assert.Nil(mt, err, "DeleteOne error: %v", err)
309309
assert.Equal(mt, int64(0), res.DeletedCount, "expected DeletedCount 0, got %v", res.DeletedCount)
310310
})
311-
mt.RunOpts("write error", mtest.NewOptions().MaxServerVersion("5.2"), func(mt *mtest.T) {
312-
// Deletes are not allowed on capped collections on MongoDB 5.2-. We use this
311+
mt.RunOpts("write error", mtest.NewOptions().MaxServerVersion("5.0.7"), func(mt *mtest.T) {
312+
// Deletes are not allowed on capped collections on MongoDB 5.0.6-. We use this
313313
// behavior to test the processing of write errors.
314314
cappedOpts := bson.D{{"capped", true}, {"size", 64 * 1024}}
315315
capped := mt.CreateCollection(mtest.Collection{
@@ -377,8 +377,8 @@ func TestCollection(t *testing.T) {
377377
assert.Nil(mt, err, "DeleteMany error: %v", err)
378378
assert.Equal(mt, int64(0), res.DeletedCount, "expected DeletedCount 0, got %v", res.DeletedCount)
379379
})
380-
mt.RunOpts("write error", mtest.NewOptions().MaxServerVersion("5.2"), func(mt *mtest.T) {
381-
// Deletes are not allowed on capped collections on MongoDB 5.2-. We use this
380+
mt.RunOpts("write error", mtest.NewOptions().MaxServerVersion("5.0.7"), func(mt *mtest.T) {
381+
// Deletes are not allowed on capped collections on MongoDB 5.0.6-. We use this
382382
// behavior to test the processing of write errors.
383383
cappedOpts := bson.D{{"capped", true}, {"size", 64 * 1024}}
384384
capped := mt.CreateCollection(mtest.Collection{
@@ -1505,8 +1505,8 @@ func TestCollection(t *testing.T) {
15051505
})
15061506
}
15071507
})
1508-
mt.RunOpts("delete write errors", mtest.NewOptions().MaxServerVersion("5.2"), func(mt *mtest.T) {
1509-
// Deletes are not allowed on capped collections on MongoDB 5.2-. We use this
1508+
mt.RunOpts("delete write errors", mtest.NewOptions().MaxServerVersion("5.0.7"), func(mt *mtest.T) {
1509+
// Deletes are not allowed on capped collections on MongoDB 5.0.6-. We use this
15101510
// behavior to test the processing of write errors.
15111511
doc := mongo.NewDeleteOneModel().SetFilter(bson.D{{"x", 1}})
15121512
models := []mongo.WriteModel{doc, doc}
@@ -1604,8 +1604,8 @@ func TestCollection(t *testing.T) {
16041604
assert.Equal(mt, expectedModel, actualModel, "expected model %v in BulkWriteException, got %v",
16051605
expectedModel, actualModel)
16061606
})
1607-
mt.RunOpts("unordered writeError index", mtest.NewOptions().MaxServerVersion("5.2"), func(mt *mtest.T) {
1608-
// Deletes are not allowed on capped collections on MongoDB 5.2-. We use this
1607+
mt.RunOpts("unordered writeError index", mtest.NewOptions().MaxServerVersion("5.0.7"), func(mt *mtest.T) {
1608+
// Deletes are not allowed on capped collections on MongoDB 5.0.6-. We use this
16091609
// behavior to test the processing of write errors.
16101610
cappedOpts := bson.D{{"capped", true}, {"size", 64 * 1024}}
16111611
capped := mt.CreateCollection(mtest.Collection{

0 commit comments

Comments
 (0)