@@ -131,7 +131,10 @@ func TestPollingSRVRecordsSpec(t *testing.T) {
131
131
t .Run (tt .name , func (t * testing.T ) {
132
132
cs , err := connstring .Parse ("mongodb+srv://test1.test.build.10gen.cc/?heartbeatFrequencyMS=100" )
133
133
require .NoError (t , err , "Problem parsing the uri: %v" , err )
134
- topo , err := New (WithConnString (func (connstring.ConnString ) connstring.ConnString { return cs }))
134
+ topo , err := New (
135
+ WithConnString (func (connstring.ConnString ) connstring.ConnString { return cs }),
136
+ WithURI (func (string ) string { return cs .Original }),
137
+ )
135
138
require .NoError (t , err , "Could not create the topology: %v" , err )
136
139
mockRes := newMockResolver (tt .recordsToAdd , tt .recordsToRemove , tt .lookupFail , tt .lookupTimeout )
137
140
topo .dnsResolver = & dns.Resolver {mockRes .LookupSRV , mockRes .LookupTXT }
@@ -167,7 +170,10 @@ func TestPollSRVRecords(t *testing.T) {
167
170
t .Run ("Not unknown or sharded topology" , func (t * testing.T ) {
168
171
cs , err := connstring .Parse ("mongodb+srv://test1.test.build.10gen.cc/?heartbeatFrequencyMS=100" )
169
172
require .NoError (t , err , "Problem parsing the uri: %v" , err )
170
- topo , err := New (WithConnString (func (connstring.ConnString ) connstring.ConnString { return cs }))
173
+ topo , err := New (
174
+ WithConnString (func (connstring.ConnString ) connstring.ConnString { return cs }),
175
+ WithURI (func (string ) string { return cs .Original }),
176
+ )
171
177
require .NoError (t , err , "Could not create the topology: %v" , err )
172
178
mockRes := newMockResolver (nil , nil , false , false )
173
179
topo .dnsResolver = & dns.Resolver {mockRes .LookupSRV , mockRes .LookupTXT }
@@ -209,7 +215,10 @@ func TestPollSRVRecords(t *testing.T) {
209
215
t .Run ("Failed Hostname Verification" , func (t * testing.T ) {
210
216
cs , err := connstring .Parse ("mongodb+srv://test1.test.build.10gen.cc/?heartbeatFrequencyMS=100" )
211
217
require .NoError (t , err , "Problem parsing the uri: %v" , err )
212
- topo , err := New (WithConnString (func (connstring.ConnString ) connstring.ConnString { return cs }))
218
+ topo , err := New (
219
+ WithConnString (func (connstring.ConnString ) connstring.ConnString { return cs }),
220
+ WithURI (func (string ) string { return cs .Original }),
221
+ )
213
222
require .NoError (t , err , "Could not create the topology: %v" , err )
214
223
mockRes := newMockResolver ([]* net.SRV {{"blah.bleh" , 27019 , 0 , 0 }, {"localhost.test.build.10gen.cc." , 27020 , 0 , 0 }}, nil , false , false )
215
224
topo .dnsResolver = & dns.Resolver {mockRes .LookupSRV , mockRes .LookupTXT }
@@ -240,7 +249,10 @@ func TestPollSRVRecords(t *testing.T) {
240
249
t .Run ("Return to polling time" , func (t * testing.T ) {
241
250
cs , err := connstring .Parse ("mongodb+srv://test1.test.build.10gen.cc/?heartbeatFrequencyMS=100" )
242
251
require .NoError (t , err , "Problem parsing the uri: %v" , err )
243
- topo , err := New (WithConnString (func (connstring.ConnString ) connstring.ConnString { return cs }))
252
+ topo , err := New (
253
+ WithConnString (func (connstring.ConnString ) connstring.ConnString { return cs }),
254
+ WithURI (func (string ) string { return cs .Original }),
255
+ )
244
256
require .NoError (t , err , "Could not create the topology: %v" , err )
245
257
mockRes := newMockResolver (nil , nil , false , false )
246
258
mockRes .fail = 1
0 commit comments