Skip to content

Commit e5cbf26

Browse files
CSHARP-3699: Bump maxWireVersion for MongoDB 5.0 (#561)
1 parent 94a1feb commit e5cbf26

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ internal abstract class Cluster : ICluster
4040
private static readonly TimeSpan __minHeartbeatIntervalDefault = TimeSpan.FromMilliseconds(500);
4141
private static readonly SemanticVersion __minSupportedServerVersion = new SemanticVersion(2, 6, 0);
4242
private static readonly IServerSelector __randomServerSelector = new RandomServerSelector();
43-
private static readonly Range<int> __supportedWireVersionRange = new Range<int>(2, 9);
43+
private static readonly Range<int> __supportedWireVersionRange = new Range<int>(2, 13);
4444

4545
// static properties
4646
/// <summary>

tests/MongoDB.Driver.Core.Tests/Core/Clusters/ClusterDescriptionTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public void IsCompatibleWithDriver_should_return_expected_result(int[] wireRange
167167
var endPoint = new DnsEndPoint("localhost", i);
168168
var serverId = new ServerId(clusterId, endPoint);
169169
var wireRange = wireRanges[i];
170-
var wireVersionRange = wireRange == 0 ? new Range<int>(0, 0) : wireRange == 1 ? new Range<int>(2, 6) : null;
170+
var wireVersionRange = wireRange == 0 ? new Range<int>(0, 0) : wireRange == 1 ? new Range<int>(2, 13) : null;
171171
var server = new ServerDescription(serverId, endPoint, wireVersionRange: wireVersionRange, type: ServerType.Standalone);
172172
subject = subject.WithServerDescription(server);
173173
}
@@ -204,7 +204,7 @@ public void IsCompatibleWithDriver_should_return_true_if_server_unknown(int[] wi
204204
var endPoint = new DnsEndPoint("localhost", i);
205205
var serverId = new ServerId(clusterId, endPoint);
206206
var wireRange = wireRanges[i];
207-
var wireVersionRange = wireRange == 0 ? new Range<int>(0, 0) : wireRange == 1 ? new Range<int>(2, 6) : null;
207+
var wireVersionRange = wireRange == 0 ? new Range<int>(0, 0) : wireRange == 1 ? new Range<int>(2, 13) : null;
208208
var server = new ServerDescription(serverId, endPoint, wireVersionRange: wireVersionRange, type: ServerType.Unknown);
209209
subject = subject.WithServerDescription(server);
210210
}

tests/MongoDB.Driver.Core.Tests/Core/Clusters/ClusterTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void SupportedWireVersionRange_should_return_expected_result()
6060
{
6161
var result = Cluster.SupportedWireVersionRange;
6262

63-
result.Should().Be(new Range<int>(2, 9));
63+
result.Should().Be(new Range<int>(2, 13));
6464
}
6565

6666
[Fact]
@@ -325,8 +325,8 @@ public void SelectServer_should_throw_if_the_matched_server_cannot_be_found_and_
325325
[Theory]
326326
[InlineData(0, 0, false)]
327327
[InlineData(0, 0, true)]
328-
[InlineData(10, 12, false)]
329-
[InlineData(10, 12, true)]
328+
[InlineData(14, 15, false)]
329+
[InlineData(14, 15, true)]
330330
public void SelectServer_should_throw_if_any_servers_are_incompatible(int min, int max, bool async)
331331
{
332332
var subject = CreateSubject();

tests/MongoDB.Driver.Core.Tests/Core/Servers/ServerDescriptionTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,10 @@ public void Equals_should_return_true_when_all_fields_are_equal()
257257
[InlineData(new[] { 6, 7 }, true)]
258258
[InlineData(new[] { 7, 7 }, true)]
259259
[InlineData(new[] { 7, 8 }, true)]
260+
[InlineData(new[] { 10, 13 }, true)]
261+
[InlineData(new[] { 10, 14 }, true)]
262+
[InlineData(new[] { 13, 15 }, true)]
263+
[InlineData(new[] { 14, 15 }, false)]
260264
public void IsCompatibleWithDriver_should_return_expected_result(int[] minMaxWireVersions, bool expectedResult)
261265
{
262266
var clusterId = new ClusterId(1);

0 commit comments

Comments
 (0)