diff --git a/mongo/client_bulk_write_test.go b/mongo/client_bulk_write_test.go index eec43f5dae..2b01444824 100644 --- a/mongo/client_bulk_write_test.go +++ b/mongo/client_bulk_write_test.go @@ -17,8 +17,6 @@ import ( func TestBatches(t *testing.T) { t.Parallel() - t.Parallel() - batches := &modelBatches{ models: make([]clientWriteModel, 2), } diff --git a/mongo/client_test.go b/mongo/client_test.go index 8465045d47..e1226610d8 100644 --- a/mongo/client_test.go +++ b/mongo/client_test.go @@ -528,11 +528,19 @@ func TestClient(t *testing.T) { } cs := integtest.ConnString(t) clientOpts := options.Client().ApplyURI(cs.Original).SetMonitor(cmdMonitor) + integtest.AddTestServerAPIVersion(clientOpts) client, err := Connect(clientOpts) assert.Nil(t, err, "Connect error: %v", err) defer func() { _ = client.Disconnect(bgCtx) }() + + serverVersion, err := getServerVersion(client.Database("admin")) + require.NoError(t, err) + if compareVersions(serverVersion, "8.0.0") < 1 { + t.Skip("skipping server version < 8.0") + } + document := bson.D{{"largeField", strings.Repeat("a", 16777216-100)}} // Adjust size to account for BSON overhead models := &ClientWriteModels{} models = models.AppendInsertOne("db", "x", NewClientInsertOneModel().SetDocument(document))