Skip to content

Commit 03015ff

Browse files
committed
CSHARP-3302: Backporting compilation fix
1 parent 2d9fe31 commit 03015ff

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

tests/MongoDB.Driver.Core.Tests/Jira/CSharp3302Tests.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,8 @@ namespace MongoDB.Driver.Core.Tests.Jira
3838
{
3939
public class CSharp3302Tests
4040
{
41-
#pragma warning disable CS0618 // Type or member is obsolete
4241
private readonly static ClusterConnectionMode __clusterConnectionMode = ClusterConnectionMode.ReplicaSet;
43-
private readonly static ConnectionModeSwitch __connectionModeSwitch = ConnectionModeSwitch.UseConnectionMode;
44-
#pragma warning restore CS0618 // Type or member is obsolete
4542
private readonly static ClusterId __clusterId = new ClusterId();
46-
private readonly static bool? __directConnection = null;
4743
private readonly static EndPoint __endPoint1 = new DnsEndPoint("localhost", 27017);
4844
private readonly static EndPoint __endPoint2 = new DnsEndPoint("localhost", 27018);
4945
private readonly static TimeSpan __heartbeatInterval = TimeSpan.FromMilliseconds(200);
@@ -55,7 +51,6 @@ public async Task RapidHeartbeatTimerCallback_should_ignore_reentrant_calls()
5551
{
5652
var clusterSettings = new ClusterSettings(
5753
connectionMode: __clusterConnectionMode,
58-
connectionModeSwitch: __connectionModeSwitch,
5954
serverSelectionTimeout: TimeSpan.FromSeconds(30),
6055
endPoints: new[] { __endPoint1 });
6156

@@ -236,7 +231,6 @@ private MultiServerCluster CreateAndSetupCluster(HashSet<ServerId> primaries)
236231

237232
var clusterSettings = new ClusterSettings(
238233
connectionMode: __clusterConnectionMode,
239-
connectionModeSwitch: __connectionModeSwitch,
240234
serverSelectionTimeout: TimeSpan.FromSeconds(30),
241235
endPoints: serverInfoCollection.Select(c => c.Endpoint).ToArray());
242236

@@ -250,7 +244,7 @@ private MultiServerCluster CreateAndSetupCluster(HashSet<ServerId> primaries)
250244
var serverMonitorConnectionFactory = CreateAndSetupServerMonitorConnectionFactory(primaries, serverInfoCollection);
251245
var serverMonitorFactory = new ServerMonitorFactory(serverMonitorSettings, serverMonitorConnectionFactory, eventCapturer);
252246

253-
var serverFactory = new ServerFactory(__clusterConnectionMode, __connectionModeSwitch, __directConnection, serverSettings, connectionPoolFactory, serverMonitorFactory, eventCapturer);
247+
var serverFactory = new ServerFactory(__clusterConnectionMode, serverSettings, connectionPoolFactory, serverMonitorFactory, eventCapturer);
254248
return new MultiServerCluster(clusterSettings, serverFactory, eventCapturer);
255249
}
256250

@@ -268,7 +262,7 @@ private IServerSelector CreateWritableServerAndEndPointSelector(EndPoint endPoin
268262
private void ForceClusterId(MultiServerCluster cluster, ClusterId clusterId)
269263
{
270264
Reflector.SetFieldValue(cluster, "_clusterId", clusterId);
271-
Reflector.SetFieldValue(cluster, "_description", ClusterDescription.CreateInitial(clusterId, __clusterConnectionMode, __connectionModeSwitch, __directConnection));
265+
Reflector.SetFieldValue(cluster, "_description", ClusterDescription.CreateInitial(clusterId, __clusterConnectionMode));
272266
}
273267

274268
private void SetupServerMonitorConnection(

0 commit comments

Comments
 (0)