Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
qingyang-hu committed Dec 4, 2024
1 parent fc91428 commit ce3ed92
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 0 additions & 2 deletions mongo/client_bulk_write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import (
func TestBatches(t *testing.T) {
t.Parallel()

t.Parallel()

batches := &modelBatches{
models: make([]clientWriteModel, 2),
}
Expand Down
8 changes: 8 additions & 0 deletions mongo/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit ce3ed92

Please sign in to comment.