File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -599,7 +599,7 @@ func TestSessionsProse(t *testing.T) {
599599
600600 pingOpts := mtest .NewOptions ().
601601 CreateCollection (false ).
602- Topologies (mtest .ReplicaSet ) // Read preference isn't sent to standalones so we can test on replica sets.
602+ Topologies (mtest .ReplicaSet , mtest . LoadBalanced )
603603 mt .RunOpts ("ping test" , pingOpts , func (mt * mtest.T ) {
604604 serverMonitor := & event.ServerMonitor {
605605 ServerHeartbeatStarted : func (e * event.ServerHeartbeatStartedEvent ) {
@@ -619,11 +619,9 @@ func TestSessionsProse(t *testing.T) {
619619 },
620620 }
621621
622- firstServerAddr := mtest .GlobalTopology ().Description ().Servers [0 ].Addr
623622 opts := options .Client ().
624- ApplyURI (fmt .Sprintf ("mongodb://%s" , firstServerAddr )).
625- SetHeartbeatInterval (500 * time .Millisecond ). // Minimum interval
626- SetReadPreference (readpref .Primary ()).
623+ ApplyURI (mtest .ClusterURI ()).
624+ SetHosts ([]string {mtest .ClusterConnString ().Hosts [0 ]}).
627625 SetDirect (true ).
628626 SetHeartbeatInterval (500 * time .Millisecond ). // Minimum interval
629627 SetServerMonitor (serverMonitor ).
You can’t perform that action at this time.
0 commit comments