-
Notifications
You must be signed in to change notification settings - Fork 893
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GODRIVER-2620 Fix hostname parsing for SRV polling. (#1112)
* GODRIVER-2620 Fix hostname parsing for SRV polling. Co-authored-by: Preston Vasquez <[email protected]> Co-authored-by: Kevin Albertson <[email protected]>
- Loading branch information
1 parent
f5312df
commit e4853fb
Showing
2 changed files
with
31 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,9 +125,21 @@ func compareHosts(t *testing.T, received []description.Server, expected []string | |
} | ||
|
||
func TestPollingSRVRecordsSpec(t *testing.T) { | ||
for _, uri := range []string{ | ||
"mongodb+srv://test1.test.build.10gen.cc/?heartbeatFrequencyMS=100", | ||
// Test with user:pass as a regression test for GODRIVER-2620 | ||
"mongodb+srv://user:[email protected]/?heartbeatFrequencyMS=100", | ||
} { | ||
t.Run(uri, func(t *testing.T) { | ||
testPollingSRVRecordsSpec(t, uri) | ||
}) | ||
} | ||
} | ||
|
||
func testPollingSRVRecordsSpec(t *testing.T, uri string) { | ||
t.Helper() | ||
for _, tt := range srvPollingTests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
uri := "mongodb+srv://test1.test.build.10gen.cc/?heartbeatFrequencyMS=100" | ||
cfg, err := NewConfig(options.Client().ApplyURI(uri), nil) | ||
require.NoError(t, err, "error constructing topology configs: %v", err) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters