File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
tests/MongoDB.Driver.TestHelpers Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 29
29
using MongoDB . Driver . Core . Operations ;
30
30
using MongoDB . Driver . Core . Servers ;
31
31
using MongoDB . Driver . Core . WireProtocol . Messages . Encoders ;
32
- using MongoDB . Driver . Encryption ;
33
32
using MongoDB . Driver . TestHelpers ;
34
33
using Xunit . Sdk ;
35
34
@@ -127,7 +126,16 @@ public static ClusterBuilder ConfigureCluster(ClusterBuilder builder)
127
126
{
128
127
builder = builder
129
128
. ConfigureWithConnectionString ( __connectionString . Value , __serverApi . Value )
130
- . ConfigureCluster ( c => c . With ( serverSelectionTimeout : __defaultServerSelectionTimeout . Value ) ) ;
129
+ . ConfigureCluster ( c => c . With ( serverSelectionTimeout : __defaultServerSelectionTimeout . Value ) )
130
+ . ConfigureServer ( s =>
131
+ {
132
+ if ( Debugger . IsAttached )
133
+ {
134
+ s = s . With ( heartbeatTimeout : TimeSpan . FromDays ( 1 ) , serverMonitoringMode : ServerMonitoringMode . Poll ) ;
135
+ }
136
+
137
+ return s ;
138
+ } ) ; ;
131
139
132
140
if ( __connectionString . Value . Tls . HasValue &&
133
141
__connectionString . Value . Tls . Value &&
Original file line number Diff line number Diff line change @@ -184,6 +184,13 @@ public static MongoClientSettings GetClientSettings()
184
184
{
185
185
serverSelectionTimeoutString = "30000" ;
186
186
}
187
+
188
+ if ( System . Diagnostics . Debugger . IsAttached )
189
+ {
190
+ clientSettings . HeartbeatTimeout = TimeSpan . FromDays ( 1 ) ;
191
+ clientSettings . ServerMonitoringMode = ServerMonitoringMode . Poll ;
192
+ }
193
+
187
194
clientSettings . ServerSelectionTimeout = TimeSpan . FromMilliseconds ( int . Parse ( serverSelectionTimeoutString ) ) ;
188
195
clientSettings . ClusterConfigurator = cb => CoreTestConfiguration . ConfigureLogging ( cb ) ;
189
196
clientSettings . ServerApi = CoreTestConfiguration . ServerApi ;
You can’t perform that action at this time.
0 commit comments