File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -631,12 +631,10 @@ func sanitizeCollectionName(db string, coll string) string {
631631}
632632
633633func (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 }
You can’t perform that action at this time.
0 commit comments