diff --git a/mongo/integration/client_test.go b/mongo/integration/client_test.go index 283d3ac535..0e478537b4 100644 --- a/mongo/integration/client_test.go +++ b/mongo/integration/client_test.go @@ -530,7 +530,7 @@ func TestClient(t *testing.T) { // Wait for all of the server's minimum RTTs to be >250ms. for _, desc := range topo.Description().Servers { server, err := topo.FindServer(desc) - assert.Nil(mt, err, "FindServer error: %v", err) + assert.NoError(mt, err, "FindServer error: %v", err) if server.RTTMonitor().Min() <= 250*time.Millisecond { return false // the tick should wait for 100ms in this case } @@ -570,7 +570,7 @@ func TestClient(t *testing.T) { // Wait for all of the server's minimum RTTs to be >250ms. for _, desc := range topo.Description().Servers { server, err := topo.FindServer(desc) - assert.Nil(mt, err, "FindServer error: %v", err) + assert.NoError(mt, err, "FindServer error: %v", err) if server.RTTMonitor().Min() <= 250*time.Millisecond { return false } @@ -613,7 +613,7 @@ func TestClient(t *testing.T) { // Wait for all of the server's RTT90s to be >300ms. for _, desc := range topo.Description().Servers { server, err := topo.FindServer(desc) - assert.Nil(mt, err, "FindServer error: %v", err) + assert.NoError(mt, err, "FindServer error: %v", err) if server.RTTMonitor().P90() <= 300*time.Millisecond { return false } @@ -656,7 +656,7 @@ func TestClient(t *testing.T) { // Wait for all of the server's RTT90s to be >275ms. for _, desc := range topo.Description().Servers { server, err := topo.FindServer(desc) - assert.Nil(mt, err, "FindServer error: %v", err) + assert.NoError(mt, err, "FindServer error: %v", err) if server.RTTMonitor().P90() <= 275*time.Millisecond { return false } diff --git a/mongo/integration/csot_prose_test.go b/mongo/integration/csot_prose_test.go index eb08008932..c8ddfd68df 100644 --- a/mongo/integration/csot_prose_test.go +++ b/mongo/integration/csot_prose_test.go @@ -91,7 +91,7 @@ func TestCSOTProse(t *testing.T) { callback := func() bool { err := mt.Client.Ping(context.Background(), nil) - assert.NotNil(mt, err, "expected Ping error, got nil") + assert.Error(mt, err, "expected Ping error, got nil") return true } @@ -110,7 +110,7 @@ func TestCSOTProse(t *testing.T) { callback := func() bool { err := mt.Client.Ping(context.Background(), nil) - assert.NotNil(mt, err, "expected Ping error, got nil") + assert.Error(mt, err, "expected Ping error, got nil") return true } @@ -129,7 +129,7 @@ func TestCSOTProse(t *testing.T) { callback := func() bool { err := mt.Client.Ping(context.Background(), nil) - assert.NotNil(mt, err, "expected Ping error, got nil") + assert.Error(mt, err, "expected Ping error, got nil") return true } @@ -148,7 +148,7 @@ func TestCSOTProse(t *testing.T) { callback := func() bool { err := mt.Client.Ping(context.Background(), nil) - assert.NotNil(mt, err, "expected Ping error, got nil") + assert.Error(mt, err, "expected Ping error, got nil") return true } diff --git a/mongo/with_transactions_test.go b/mongo/with_transactions_test.go index a9683ccfbf..544053b973 100644 --- a/mongo/with_transactions_test.go +++ b/mongo/with_transactions_test.go @@ -403,7 +403,7 @@ func TestConvenientTransactions(t *testing.T) { transactionCtx, cancel := context.WithCancel(context.Background()) _, _ = sess.WithTransaction(transactionCtx, func(ctx SessionContext) (interface{}, error) { _, err := coll.InsertOne(ctx, bson.M{"x": 1}) - assert.Nil(t, err, "InsertOne error: %v", err) + assert.NoError(t, err, "InsertOne error: %v", err) cancel() return nil, nil }) @@ -564,7 +564,7 @@ func TestConvenientTransactions(t *testing.T) { _, err := coll.InsertOne(c, bson.D{{}}) return nil, err }) - assert.Nil(t, err, "WithTransaction error: %v", err) + assert.NoError(t, err, "WithTransaction error: %v", err) return true }