Skip to content

Commit 17c4846

Browse files
committed
updates
1 parent d72dcff commit 17c4846

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

mongo/integration/mtest/mongotest.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -744,13 +744,9 @@ func (t *T) createTestClient() {
744744
if err != nil {
745745
t.Fatalf("error creating client: %v", err)
746746
}
747-
ctx := context.Background()
748-
if err := t.Client.Connect(ctx); err != nil {
747+
if err := t.Client.Connect(context.Background()); err != nil {
749748
t.Fatalf("error connecting client: %v", err)
750749
}
751-
if err := t.Client.Ping(ctx, nil); err != nil {
752-
t.Fatalf("error pinging client: %v", err)
753-
}
754750
}
755751

756752
func (t *T) createTestCollection() {

mongo/integration/unified_spec_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@ func runSpecTestCase(mt *mtest.T, test *testCase, testFile testFile) {
312312
testClientOpts.SetHeartbeatInterval(defaultHeartbeatInterval)
313313
}
314314
mt.ResetClient(testClientOpts)
315+
if err := mt.Client.Ping(context.Background(), nil); err != nil {
316+
assert.Nil(mt, err, "error pinging client")
317+
}
315318

316319
// Record the underlying topology for the test's Client.
317320
test.testTopology = getTopologyFromClient(mt.Client)

0 commit comments

Comments
 (0)