Skip to content

Commit

Permalink
CSHARP-3302: Backporting compilation fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BorisDog committed Jan 20, 2021
1 parent 2d9fe31 commit 03015ff
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions tests/MongoDB.Driver.Core.Tests/Jira/CSharp3302Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,8 @@ namespace MongoDB.Driver.Core.Tests.Jira
{
public class CSharp3302Tests
{
#pragma warning disable CS0618 // Type or member is obsolete
private readonly static ClusterConnectionMode __clusterConnectionMode = ClusterConnectionMode.ReplicaSet;
private readonly static ConnectionModeSwitch __connectionModeSwitch = ConnectionModeSwitch.UseConnectionMode;
#pragma warning restore CS0618 // Type or member is obsolete
private readonly static ClusterId __clusterId = new ClusterId();
private readonly static bool? __directConnection = null;
private readonly static EndPoint __endPoint1 = new DnsEndPoint("localhost", 27017);
private readonly static EndPoint __endPoint2 = new DnsEndPoint("localhost", 27018);
private readonly static TimeSpan __heartbeatInterval = TimeSpan.FromMilliseconds(200);
Expand All @@ -55,7 +51,6 @@ public async Task RapidHeartbeatTimerCallback_should_ignore_reentrant_calls()
{
var clusterSettings = new ClusterSettings(
connectionMode: __clusterConnectionMode,
connectionModeSwitch: __connectionModeSwitch,
serverSelectionTimeout: TimeSpan.FromSeconds(30),
endPoints: new[] { __endPoint1 });

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

var clusterSettings = new ClusterSettings(
connectionMode: __clusterConnectionMode,
connectionModeSwitch: __connectionModeSwitch,
serverSelectionTimeout: TimeSpan.FromSeconds(30),
endPoints: serverInfoCollection.Select(c => c.Endpoint).ToArray());

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

var serverFactory = new ServerFactory(__clusterConnectionMode, __connectionModeSwitch, __directConnection, serverSettings, connectionPoolFactory, serverMonitorFactory, eventCapturer);
var serverFactory = new ServerFactory(__clusterConnectionMode, serverSettings, connectionPoolFactory, serverMonitorFactory, eventCapturer);
return new MultiServerCluster(clusterSettings, serverFactory, eventCapturer);
}

Expand All @@ -268,7 +262,7 @@ private IServerSelector CreateWritableServerAndEndPointSelector(EndPoint endPoin
private void ForceClusterId(MultiServerCluster cluster, ClusterId clusterId)
{
Reflector.SetFieldValue(cluster, "_clusterId", clusterId);
Reflector.SetFieldValue(cluster, "_description", ClusterDescription.CreateInitial(clusterId, __clusterConnectionMode, __connectionModeSwitch, __directConnection));
Reflector.SetFieldValue(cluster, "_description", ClusterDescription.CreateInitial(clusterId, __clusterConnectionMode));
}

private void SetupServerMonitorConnection(
Expand Down

0 comments on commit 03015ff

Please sign in to comment.