Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
qingyang-hu committed Aug 8, 2024
1 parent dec3ddf commit c4c67dd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions mongo/integration/unified_spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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,
}
)

Expand Down
2 changes: 1 addition & 1 deletion mongo/options/clientoptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion mongo/options/clientoptions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c4c67dd

Please sign in to comment.