Skip to content

Commit 1cc033d

Browse files
CSHARP-4011: Bump maxWireVersion for MongoDB 5.2. (#721)
1 parent 149b2e7 commit 1cc033d

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
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(3, 6, 0);
4242
private static readonly IServerSelector __randomServerSelector = new RandomServerSelector();
43-
private static readonly Range<int> __supportedWireVersionRange = new Range<int>(6, 14);
43+
private static readonly Range<int> __supportedWireVersionRange = new Range<int>(6, 15);
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>(6, 14) : null;
170+
var wireVersionRange = wireRange == 0 ? new Range<int>(0, 0) : wireRange == 1 ? new Range<int>(6, 15) : 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>(6, 14) : null;
207+
var wireVersionRange = wireRange == 0 ? new Range<int>(0, 0) : wireRange == 1 ? new Range<int>(6, 15) : 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>(6, 14));
63+
result.Should().Be(new Range<int>(6, 15));
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(15, 16, false)]
329-
[InlineData(15, 16, true)]
328+
[InlineData(16, 17, false)]
329+
[InlineData(16, 17, 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/Helpers/ServerDescriptionHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static ServerDescription Connected(ClusterId clusterId, EndPoint endPoint
3838
tags: tags,
3939
type: serverType,
4040
version: new SemanticVersion(3, 6, 0),
41-
wireVersionRange: wireVersionRange ?? new Range<int>(6, 14));
41+
wireVersionRange: wireVersionRange ?? Cluster.SupportedWireVersionRange);
4242
}
4343
}
4444
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ public void Equals_should_return_true_when_all_fields_are_equal()
274274
[InlineData(new[] { 10, 14 }, true)]
275275
[InlineData(new[] { 13, 15 }, true)]
276276
[InlineData(new[] { 14, 15 }, true)]
277-
[InlineData(new[] { 15, 16 }, false)]
277+
[InlineData(new[] { 15, 16 }, true)]
278+
[InlineData(new[] { 16, 17 }, false)]
278279
public void IsCompatibleWithDriver_should_return_expected_result(int[] minMaxWireVersions, bool expectedResult)
279280
{
280281
var clusterId = new ClusterId(1);

0 commit comments

Comments
 (0)