From c4c67dda5df6043dd4b53a31aef1545a8b2f1e8d Mon Sep 17 00:00:00 2001 From: Qingyang Hu Date: Thu, 8 Aug 2024 16:50:38 -0400 Subject: [PATCH] updates --- mongo/integration/unified_spec_test.go | 11 +++++++---- mongo/options/clientoptions.go | 2 +- mongo/options/clientoptions_test.go | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/mongo/integration/unified_spec_test.go b/mongo/integration/unified_spec_test.go index 67c1f9a2d3c..df2d705132b 100644 --- a/mongo/integration/unified_spec_test.go +++ b/mongo/integration/unified_spec_test.go @@ -42,6 +42,7 @@ const ( gridFSFiles = "fs.files" gridFSChunks = "fs.chunks" spec1403SkipReason = "servers less than 4.2 do not have mongocryptd; see SPEC-1403" + godriver2466SkipReason = "test has not been updated; see GODRIVER-2466" godriver2413SkipReason = "encryptedFields argument is not supported on Collection.Drop; see GODRIVER-2413" ) @@ -51,10 +52,12 @@ var ( // SPEC-1403: This test checks to see if the correct error is thrown when auto encrypting with a server < 4.2. // Currently, the test will fail because a server < 4.2 wouldn't have mongocryptd, so Client construction // would fail with a mongocryptd spawn error. - "operation fails with maxWireVersion < 8": spec1403SkipReason, - "CreateCollection from encryptedFields.": godriver2413SkipReason, - "DropCollection from encryptedFields": godriver2413SkipReason, - "DropCollection from remote encryptedFields": godriver2413SkipReason, + "operation fails with maxWireVersion < 8": spec1403SkipReason, + // GODRIVER-2466: The test below has not been updated as required. + "Network error on minPoolSize background creation": godriver2466SkipReason, + "CreateCollection from encryptedFields.": godriver2413SkipReason, + "DropCollection from encryptedFields": godriver2413SkipReason, + "DropCollection from remote encryptedFields": godriver2413SkipReason, } ) diff --git a/mongo/options/clientoptions.go b/mongo/options/clientoptions.go index a342f9a49ee..180d0399696 100644 --- a/mongo/options/clientoptions.go +++ b/mongo/options/clientoptions.go @@ -315,7 +315,7 @@ func (c *ClientOptions) validate() error { // Direct connections cannot be made if multiple hosts are specified or an SRV URI is used. if c.Direct != nil && *c.Direct { if len(c.Hosts) > 1 { - return fmt.Errorf("a direct connection cannot be made if multiple hosts are specified: %v", c.Hosts) + return errors.New("a direct connection cannot be made if multiple hosts are specified") } if c.cs != nil && c.cs.Scheme == connstring.SchemeMongoDBSRV { return errors.New("a direct connection cannot be made if an SRV URI is used") diff --git a/mongo/options/clientoptions_test.go b/mongo/options/clientoptions_test.go index 23163322eca..d6d39f298dc 100644 --- a/mongo/options/clientoptions_test.go +++ b/mongo/options/clientoptions_test.go @@ -600,7 +600,7 @@ func TestClientOptions(t *testing.T) { }) t.Run("direct connection validation", func(t *testing.T) { t.Run("multiple hosts", func(t *testing.T) { - expectedErr := errors.New("a direct connection cannot be made if multiple hosts are specified: [localhost localhost2]") + expectedErr := errors.New("a direct connection cannot be made if multiple hosts are specified") testCases := []struct { name string