Skip to content

Commit 355028d

Browse files
committed
Respond to PR feedback.
1 parent ad1fd0e commit 355028d

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

mongo/integration/client_test.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -479,18 +479,17 @@ func TestClientStress(t *testing.T) {
479479
// TODO: Enable with GODRIVER-2038.
480480
t.Skip("TODO: Enable with GODRIVER-2038")
481481

482-
mtOpts := mtest.NewOptions().
483-
MinServerVersion("3.6").
484-
Topologies(mtest.ReplicaSet, mtest.Sharded, mtest.Single).
485-
CreateClient(false)
482+
testutil.Integration(t)
483+
484+
mtOpts := mtest.NewOptions().CreateClient(false)
486485
mt := mtest.New(t, mtOpts)
487486

488487
// Test that a Client can recover from a massive traffic spike after the traffic spike is over.
489488
mt.Run("Client recovers from traffic spike", func(mt *mtest.T) {
490489
oid := primitive.NewObjectID()
491490
doc := bson.D{{Key: "_id", Value: oid}, {Key: "key", Value: "value"}}
492491
_, err := mt.Coll.InsertOne(context.Background(), doc)
493-
assert.Nil(mt, err, "unexpected error inserting document: %v", err)
492+
assert.Nil(mt, err, "InsertOne error: %v", err)
494493

495494
// findOne calls FindOne("_id": oid) on the given collection and with the given timeout. It
496495
// returns any errors.
@@ -521,7 +520,7 @@ func TestClientStress(t *testing.T) {
521520
for i := 0; i < 50; i++ {
522521
start := time.Now()
523522
err := findOne(mt.Coll, 10*time.Second)
524-
assert.Nil(t, err, "unexpected error calling FindOne: %v", err)
523+
assert.Nil(t, err, "FindOne error: %v", err)
525524
duration := time.Since(start)
526525
if duration > maxRTT {
527526
maxRTT = duration
@@ -538,7 +537,7 @@ func TestClientStress(t *testing.T) {
538537
mt.RunOpts(fmt.Sprintf("maxPoolSize %d", maxPoolSize), maxPoolSizeOpt, func(mt *mtest.T) {
539538
doc := bson.D{{Key: "_id", Value: oid}, {Key: "key", Value: "value"}}
540539
_, err := mt.Coll.InsertOne(context.Background(), doc)
541-
assert.Nil(mt, err, "unexpected error inserting document: %v", err)
540+
assert.Nil(mt, err, "InsertOne error: %v", err)
542541

543542
// Set the timeout to be 10x the maximum observed RTT. Use a minimum 10ms timeout to
544543
// prevent spurious test failures due to extremely low timeouts.

x/mongo/driver/topology/polling_srv_records_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"time"
1717

1818
"github.com/stretchr/testify/require"
19+
"go.mongodb.org/mongo-driver/internal/testutil"
1920
"go.mongodb.org/mongo-driver/internal/testutil/assert"
2021
"go.mongodb.org/mongo-driver/mongo/address"
2122
"go.mongodb.org/mongo-driver/mongo/description"
@@ -125,9 +126,8 @@ func compareHosts(t *testing.T, received []description.Server, expected []string
125126
}
126127

127128
func TestPollingSRVRecordsSpec(t *testing.T) {
128-
if testing.Short() {
129-
t.Skip("skipping integration test in short mode")
130-
}
129+
testutil.Integration(t)
130+
131131
for _, tt := range srvPollingTests {
132132
t.Run(tt.name, func(t *testing.T) {
133133
cs, err := connstring.ParseAndValidate("mongodb+srv://test1.test.build.10gen.cc/?heartbeatFrequencyMS=100")
@@ -165,9 +165,8 @@ func TestPollingSRVRecordsSpec(t *testing.T) {
165165
}
166166

167167
func TestPollSRVRecords(t *testing.T) {
168-
if testing.Short() {
169-
t.Skip("skipping integration test in short mode")
170-
}
168+
testutil.Integration(t)
169+
171170
t.Run("Not unknown or sharded topology", func(t *testing.T) {
172171
cs, err := connstring.ParseAndValidate("mongodb+srv://test1.test.build.10gen.cc/?heartbeatFrequencyMS=100")
173172
require.NoError(t, err, "Problem parsing the uri: %v", err)

0 commit comments

Comments
 (0)