Skip to content

Commit bc2efae

Browse files
author
Oleksandr Poliakov
committed
CSHARP-5608: CSOT: Command Execution
1 parent cc69339 commit bc2efae

File tree

7 files changed

+209
-318
lines changed

7 files changed

+209
-318
lines changed

src/MongoDB.Driver/Core/Clusters/Cluster.cs

Lines changed: 204 additions & 190 deletions
Large diffs are not rendered by default.

src/MongoDB.Driver/Core/Clusters/ServerSelectors/OperationsCountServerSelector.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ namespace MongoDB.Driver.Core.Clusters.ServerSelectors
2222
{
2323
internal sealed class OperationsCountServerSelector : IServerSelector
2424
{
25-
private readonly IEnumerable<IClusterableServer> _clusterableServers;
25+
private readonly IReadOnlyList<IClusterableServer> _clusterableServers;
2626

27-
public OperationsCountServerSelector(IEnumerable<IClusterableServer> clusterableServers)
27+
public OperationsCountServerSelector(IReadOnlyList<IClusterableServer> clusterableServers)
2828
{
2929
_clusterableServers = clusterableServers;
3030
}

src/MongoDB.Driver/Core/Clusters/ServerSelectors/RandomServerSelector.cs

Lines changed: 0 additions & 58 deletions
This file was deleted.

tests/MongoDB.Driver.Tests/Core/Clusters/ServerSelectors/RandomServerSelectorTests.cs

Lines changed: 0 additions & 65 deletions
This file was deleted.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ private IServerSelector CreateWritableServerAndEndPointSelector(EndPoint endPoin
289289
private void ForceClusterId(MultiServerCluster cluster, ClusterId clusterId)
290290
{
291291
Reflector.SetFieldValue(cluster, "_clusterId", clusterId);
292-
Reflector.SetFieldValue(cluster, "_descriptionWithChangedTaskCompletionSource", new Cluster.ClusterDescriptionChangeSource(ClusterDescription.CreateInitial(clusterId, __directConnection)));
292+
Reflector.SetFieldValue(cluster, "_descriptionWithChangedTaskCompletionSource", new Cluster.ClusterDescriptionChangeSource(cluster, ClusterDescription.CreateInitial(clusterId, __directConnection)));
293293
}
294294

295295
private void SetupServerMonitorConnection(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ private IServerSelector CreateWritableServerAndEndPointSelector(EndPoint endPoin
270270
private void ForceClusterId(MultiServerCluster cluster, ClusterId clusterId)
271271
{
272272
Reflector.SetFieldValue(cluster, "_clusterId", clusterId);
273-
Reflector.SetFieldValue(cluster, "_descriptionWithChangedTaskCompletionSource", new Cluster.ClusterDescriptionChangeSource(ClusterDescription.CreateInitial(clusterId, __directConnection)));
273+
Reflector.SetFieldValue(cluster, "_descriptionWithChangedTaskCompletionSource", new Cluster.ClusterDescriptionChangeSource(cluster, ClusterDescription.CreateInitial(clusterId, __directConnection)));
274274
}
275275

276276
private void SetupServerMonitorConnection(

tests/MongoDB.Driver.Tests/Core/Logging/EventLoggerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private static IEnumerable<object[]> EventsData()
9494
(new LogCategories.Command(), new CommandStartedEvent("test", new Bson.BsonDocument(), new DatabaseNamespace("test"), 1, 1, connectionId)),
9595
(new LogCategories.Connection(), new ConnectionCreatedEvent(connectionId, null, 1)),
9696
(new LogCategories.SDAM(), new ServerHeartbeatStartedEvent(connectionId, true)),
97-
(new LogCategories.ServerSelection(), new ClusterSelectingServerEvent(clusterDescription, new RandomServerSelector(), default, default))
97+
(new LogCategories.ServerSelection(), new ClusterSelectingServerEvent(clusterDescription, Mock.Of<IServerSelector>(), default, default))
9898
};
9999

100100
var booleanValues = new[] { true, false };

0 commit comments

Comments
 (0)