@@ -128,10 +128,10 @@ type T struct {
128
128
succeeded []* event.CommandSucceededEvent
129
129
failed []* event.CommandFailedEvent
130
130
131
- Client * mongo.Client
132
- // fpClient *mongo.Client
133
- DB * mongo.Database
134
- Coll * mongo.Collection
131
+ Client * mongo.Client
132
+ fpClient * mongo.Client
133
+ DB * mongo.Database
134
+ Coll * mongo.Collection
135
135
}
136
136
137
137
func newT (wrapped * testing.T , opts ... * Options ) * T {
@@ -186,7 +186,7 @@ func New(wrapped *testing.T, opts ...*Options) *T {
186
186
// otherwise, a new client will be created for each subtest
187
187
if t .shareClient != nil && * t .shareClient {
188
188
t .Client = t .createTestClient (t .clientOpts )
189
- // t.fpClient = t.createTestClient(t.clientOpts)
189
+ t .fpClient = t .createTestClient (t .clientOpts )
190
190
}
191
191
192
192
wrapped .Cleanup (t .cleanup )
@@ -210,7 +210,7 @@ func (t *T) cleanup() {
210
210
// always disconnect the client regardless of clientType because Client.Disconnect will work against
211
211
// all deployments
212
212
_ = t .Client .Disconnect (context .Background ())
213
- // _ = t.fpClient.Disconnect(context.Background())
213
+ _ = t .fpClient .Disconnect (context .Background ())
214
214
}
215
215
216
216
// Run creates a new T instance for a sub-test and runs the given callback. It also creates a new collection using the
@@ -243,13 +243,13 @@ func (t *T) RunOpts(name string, opts *Options, callback func(mt *T)) {
243
243
// for shareClient, inherit the client from the parent
244
244
if sub .shareClient != nil && * sub .shareClient && sub .clientType == t .clientType {
245
245
sub .Client = t .Client
246
- // sub.fpClient = t.fpClient
246
+ sub .fpClient = t .fpClient
247
247
}
248
248
// only create a client if not already set
249
249
if sub .Client == nil {
250
250
if sub .createClient == nil || * sub .createClient {
251
251
sub .Client = sub .createTestClient (sub .clientOpts )
252
- // sub.fpClient = sub.createTestClient(sub.clientOpts)
252
+ sub .fpClient = sub .createTestClient (sub .clientOpts )
253
253
}
254
254
}
255
255
// create a collection for this test
@@ -275,7 +275,7 @@ func (t *T) RunOpts(name string, opts *Options, callback func(mt *T)) {
275
275
// only disconnect client if it's not being shared
276
276
if sub .shareClient == nil || ! * sub .shareClient {
277
277
_ = sub .Client .Disconnect (context .Background ())
278
- // _ = sub.fpClient.Disconnect(context.Background())
278
+ _ = sub .fpClient .Disconnect (context .Background ())
279
279
}
280
280
assert .Equal (sub , 0 , sessions , "%v sessions checked out" , sessions )
281
281
assert .Equal (sub , 0 , conns , "%v connections checked out" , conns )
@@ -425,9 +425,9 @@ func (t *T) ResetClient(opts *options.ClientOptions) {
425
425
}
426
426
427
427
_ = t .Client .Disconnect (context .Background ())
428
- // _ = t.fpClient.Disconnect(context.Background())
428
+ _ = t .fpClient .Disconnect (context .Background ())
429
429
t .Client = t .createTestClient (t .clientOpts )
430
- // t.fpClient = t.createTestClient(t.clientOpts)
430
+ t .fpClient = t .createTestClient (t .clientOpts )
431
431
t .DB = t .Client .Database (t .dbName )
432
432
t .Coll = t .DB .Collection (t .collName , t .collOpts )
433
433
@@ -607,12 +607,7 @@ func (t *T) TrackFailPoint(fpName string) {
607
607
608
608
// ClearFailPoints disables all previously set failpoints for this test.
609
609
func (t * T ) ClearFailPoints () {
610
- clientOpts := t .clientOpts
611
- if clientOpts != nil {
612
- clientOpts .AutoEncryptionOptions = nil
613
- }
614
- client := t .createTestClient (clientOpts )
615
- db := client .Database ("admin" )
610
+ db := t .Client .Database ("admin" )
616
611
for _ , fp := range t .failPointNames {
617
612
cmd := bson.D {
618
613
{"configureFailPoint" , fp },
0 commit comments