Skip to content

Commit e8f73ff

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

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

internal/testutil/config.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -318,15 +318,6 @@ func GetDBName(cs connstring.ConnString) string {
318318
return fmt.Sprintf("mongo-go-driver-%d", os.Getpid())
319319
}
320320

321-
// Integration should be called at the beginning of integration
322-
// tests to ensure that they are skipped if integration testing is
323-
// turned off.
324-
func Integration(t *testing.T) {
325-
if testing.Short() {
326-
t.Skip("skipping integration test in short mode")
327-
}
328-
}
329-
330321
// compareVersions compares two version number strings (i.e. positive integers separated by
331322
// periods). Comparisons are done to the lesser precision of the two versions. For example, 3.2 is
332323
// considered equal to 3.2.11, whereas 3.2.0 is considered less than 3.2.11.

mongo/integration/client_test.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -479,18 +479,19 @@ 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+
if testing.Short() {
483+
t.Skip("skipping integration test in short mode")
484+
}
485+
486+
mtOpts := mtest.NewOptions().CreateClient(false)
486487
mt := mtest.New(t, mtOpts)
487488

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

495496
// findOne calls FindOne("_id": oid) on the given collection and with the given timeout. It
496497
// returns any errors.
@@ -521,7 +522,7 @@ func TestClientStress(t *testing.T) {
521522
for i := 0; i < 50; i++ {
522523
start := time.Now()
523524
err := findOne(mt.Coll, 10*time.Second)
524-
assert.Nil(t, err, "unexpected error calling FindOne: %v", err)
525+
assert.Nil(t, err, "FindOne error: %v", err)
525526
duration := time.Since(start)
526527
if duration > maxRTT {
527528
maxRTT = duration
@@ -538,7 +539,7 @@ func TestClientStress(t *testing.T) {
538539
mt.RunOpts(fmt.Sprintf("maxPoolSize %d", maxPoolSize), maxPoolSizeOpt, func(mt *mtest.T) {
539540
doc := bson.D{{Key: "_id", Value: oid}, {Key: "key", Value: "value"}}
540541
_, err := mt.Coll.InsertOne(context.Background(), doc)
541-
assert.Nil(mt, err, "unexpected error inserting document: %v", err)
542+
assert.Nil(mt, err, "InsertOne error: %v", err)
542543

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

0 commit comments

Comments
 (0)