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 5d29b75 commit dec3ddf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
13 changes: 4 additions & 9 deletions mongo/integration/unified_spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const (
gridFSFiles = "fs.files"
gridFSChunks = "fs.chunks"
spec1403SkipReason = "servers less than 4.2 do not have mongocryptd; see SPEC-1403"
godriver2123SkipReason = "failpoints and timeouts together cause failures; see GODRIVER-2123"
godriver2413SkipReason = "encryptedFields argument is not supported on Collection.Drop; see GODRIVER-2413"
)

Expand All @@ -52,14 +51,10 @@ 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,
// GODRIVER-2123: The test below use a failpoint and a socket or server selection timeout.
// The timeout causes the eventual clearing of the failpoint in the test runner to fail with an
// i/o timeout.
"Network error on minPoolSize background creation": godriver2123SkipReason,
"CreateCollection from encryptedFields.": godriver2413SkipReason,
"DropCollection from encryptedFields": godriver2413SkipReason,
"DropCollection from remote encryptedFields": godriver2413SkipReason,
"operation fails with maxWireVersion < 8": spec1403SkipReason,
"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 errors.New("a direct connection cannot be made if multiple hosts are specified")
return fmt.Errorf("a direct connection cannot be made if multiple hosts are specified: %v", c.Hosts)
}
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")
expectedErr := errors.New("a direct connection cannot be made if multiple hosts are specified: [localhost localhost2]")

testCases := []struct {
name string
Expand Down

0 comments on commit dec3ddf

Please sign in to comment.