From 004abe681b23458a554149d76823f31e4feec488 Mon Sep 17 00:00:00 2001 From: Chi Fujii Date: Tue, 12 Mar 2024 14:38:50 +0900 Subject: [PATCH] remove confusing error message --- integration/commands_authentication_test.go | 4 ++-- integration/users/connection_test.go | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/integration/commands_authentication_test.go b/integration/commands_authentication_test.go index 559442929907..b5f4bc7bc6a6 100644 --- a/integration/commands_authentication_test.go +++ b/integration/commands_authentication_test.go @@ -36,7 +36,7 @@ func TestCommandsAuthenticationLogout(t *testing.T) { opts := options.Client().ApplyURI(s.MongoDBURI) client, err := mongo.Connect(ctx, opts) - require.NoError(t, err, "cannot connect to MongoDB") + require.NoError(t, err) t.Cleanup(func() { require.NoError(t, client.Disconnect(ctx)) @@ -90,7 +90,7 @@ func TestCommandsAuthenticationLogoutAuthenticatedUser(t *testing.T) { opts := options.Client().ApplyURI(s.MongoDBURI).SetAuth(credential) client, err := mongo.Connect(ctx, opts) - require.NoError(t, err, "cannot connect to MongoDB") + require.NoError(t, err) t.Cleanup(func() { require.NoError(t, client.Disconnect(ctx)) diff --git a/integration/users/connection_test.go b/integration/users/connection_test.go index 1454bb1b2735..14cb513deb89 100644 --- a/integration/users/connection_test.go +++ b/integration/users/connection_test.go @@ -207,7 +207,7 @@ func TestAuthentication(t *testing.T) { opts := options.Client().ApplyURI(s.MongoDBURI).SetAuth(credential) client, err := mongo.Connect(ctx, opts) - require.NoError(t, err, "cannot connect to MongoDB") + require.NoError(t, err) // Ping to force connection to be established and tested. err = client.Ping(ctx, nil) @@ -222,7 +222,7 @@ func TestAuthentication(t *testing.T) { return } - require.NoError(t, err, "cannot ping MongoDB") + require.NoError(t, err) connCollection := client.Database(db.Name()).Collection(collection.Name()) @@ -268,7 +268,7 @@ func TestAuthenticationOnAuthenticatedConnection(t *testing.T) { opts := options.Client().ApplyURI(s.MongoDBURI).SetAuth(credential) client, err := mongo.Connect(ctx, opts) - require.NoError(t, err, "cannot connect to MongoDB") + require.NoError(t, err) t.Cleanup(func() { require.NoError(t, client.Disconnect(ctx)) @@ -336,7 +336,7 @@ func TestAuthenticationLocalhostException(tt *testing.T) { opts := options.Client().ApplyURI(s.MongoDBURI) clientNoAuth, err := mongo.Connect(ctx, opts) - require.NoError(t, err, "cannot connect to MongoDB") + require.NoError(t, err) t.Cleanup(func() { require.NoError(t, clientNoAuth.Disconnect(ctx)) @@ -377,7 +377,7 @@ func TestAuthenticationLocalhostException(tt *testing.T) { opts = options.Client().ApplyURI(s.MongoDBURI).SetAuth(credential) client, err := mongo.Connect(ctx, opts) - require.NoError(t, err, "cannot connect to MongoDB") + require.NoError(t, err) t.Cleanup(func() { require.NoError(t, client.Disconnect(ctx)) @@ -471,7 +471,7 @@ func TestAuthenticationEnableNewAuthPLAIN(tt *testing.T) { opts := options.Client().ApplyURI(s.MongoDBURI).SetAuth(credential) client, err := mongo.Connect(ctx, opts) - require.NoError(t, err, "cannot connect to MongoDB") + require.NoError(t, err) t.Cleanup(func() { require.NoError(t, client.Disconnect(ctx))