Skip to content

Commit e9db4b5

Browse files
committed
Clarify logic
1 parent a1316e4 commit e9db4b5

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

internal/integration/csot_prose_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,8 @@ func TestCSOTProse(t *testing.T) {
227227
SetTimeout(2 * time.Second).
228228
SetMonitor(cm).
229229
ApplyURI(mtest.ClusterURI())
230-
integtest.AddTestServerAPIVersion(cliOptions)
231-
cli, err := mongo.Connect(cliOptions)
232-
require.NoError(mt, err, "Connect error: %v", err)
233-
_, err = cli.BulkWrite(context.Background(), writes)
230+
mt.ResetClient(cliOptions)
231+
_, err = mt.Client.BulkWrite(context.Background(), writes)
234232
assert.ErrorIs(mt, err, context.DeadlineExceeded, "expected a timeout error, got: %v", err)
235233
assert.Equal(mt, 2, cnt, "expected bulkWrite calls: %d, got: %d", 2, cnt)
236234
})

mongo/client_bulk_write.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
package mongo
88

99
import (
10-
"bytes"
1110
"context"
1211
"errors"
1312
"fmt"
@@ -427,9 +426,7 @@ func (mb *modelBatches) processResponse(ctx context.Context, resp bsoncore.Docum
427426
Code int32
428427
Errmsg string
429428
}
430-
dec := bson.NewDecoder(bson.NewDocumentReader(bytes.NewReader(resp)))
431-
dec.SetRegistry(mb.client.registry)
432-
err := dec.Decode(&res)
429+
err := bson.Unmarshal(resp, &res)
433430
if err != nil {
434431
return err
435432
}

0 commit comments

Comments
 (0)