@@ -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
@@ -580,7 +580,7 @@ func (t *T) SetFailPoint(fp FailPoint) {
580
580
}
581
581
}
582
582
583
- if err := SetFailPoint (fp , t .fpClient ); err != nil {
583
+ if err := SetFailPoint (fp , t .Client ); err != nil {
584
584
t .Fatal (err )
585
585
}
586
586
t .failPointNames = append (t .failPointNames , fp .ConfigureFailPoint )
@@ -591,7 +591,7 @@ func (t *T) SetFailPoint(fp FailPoint) {
591
591
// the failpoint will appear in command monitoring channels. The fail point will be automatically disabled after this
592
592
// test has run.
593
593
func (t * T ) SetFailPointFromDocument (fp bson.Raw ) {
594
- if err := SetRawFailPoint (fp , t .fpClient ); err != nil {
594
+ if err := SetRawFailPoint (fp , t .Client ); err != nil {
595
595
t .Fatal (err )
596
596
}
597
597
@@ -607,7 +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
- db := t .fpClient .Database ("admin" )
610
+ db := t .Client .Database ("admin" )
611
611
for _ , fp := range t .failPointNames {
612
612
cmd := bson.D {
613
613
{"configureFailPoint" , fp },
0 commit comments