Skip to content

Commit f0def31

Browse files
committed
updates
1 parent c80f502 commit f0def31

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

mongo/integration/mtest/mongotest.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -631,12 +631,10 @@ func sanitizeCollectionName(db string, coll string) string {
631631
}
632632

633633
func (t *T) createTestClient() {
634-
var clientOpts *options.ClientOptions
635-
if t.clientOpts == nil {
634+
clientOpts := t.clientOpts
635+
if clientOpts == nil {
636636
// default opts
637637
clientOpts = options.Client().SetWriteConcern(MajorityWc).SetReadPreference(PrimaryRp)
638-
} else {
639-
clientOpts = options.MergeClientOptions(t.clientOpts)
640638
}
641639
// set ServerAPIOptions to latest version if required
642640
if clientOpts.Deployment == nil && t.clientType != Mock && clientOpts.ServerAPIOptions == nil && testContext.requireAPIVersion {
@@ -728,8 +726,9 @@ func (t *T) createTestClient() {
728726
t.Fatalf("error connecting client: %v", err)
729727
}
730728

731-
clientOpts.AutoEncryptionOptions = nil
732-
t.fpClient, err = mongo.NewClient(uriOpts, clientOpts)
729+
fpOpts := options.MergeClientOptions(uriOpts, clientOpts)
730+
fpOpts.AutoEncryptionOptions = nil
731+
t.fpClient, err = mongo.NewClient(fpOpts)
733732
if err != nil {
734733
t.Fatalf("error creating client: %v", err)
735734
}

0 commit comments

Comments
 (0)