diff --git a/Directory.Build.props b/Directory.Build.props index c8b86ceed..6e15dbd85 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,7 +3,7 @@ 3.34.0 3.34.0 preview - 3.31.1 + 3.31.2 2.0.2 2.0.2 preview diff --git a/Microsoft.Azure.Cosmos/src/Regions.cs b/Microsoft.Azure.Cosmos/src/Regions.cs index 666ec0435..33c258aaf 100644 --- a/Microsoft.Azure.Cosmos/src/Regions.cs +++ b/Microsoft.Azure.Cosmos/src/Regions.cs @@ -359,5 +359,10 @@ namespace Microsoft.Azure.Cosmos /// Name of the Azure Italy North region in the Azure Cosmos DB service. /// public const string ItalyNorth = "Italy North"; + + /// + /// Name of the Azure Israel Central region in the Azure Cosmos DB service. + /// + public const string IsraelCentral = "Israel Central"; } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs index e977a8b45..e07fe85a7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs @@ -205,7 +205,7 @@ public async Task CreateAndInitializeAsync_WithValidDatabaseAndContainer_ShouldOpenRntbdConnectionsToBackendReplicas() { // Arrange. - int httpCallsMade = 0; + int httpCallsMade = 0, maxRequestsPerConnection = 6; HttpClientHandlerHelper httpClientHandlerHelper = new () { RequestCallBack = (request, cancellationToken) => @@ -227,6 +227,7 @@ { HttpClientFactory = () => new HttpClient(httpClientHandlerHelper), ConnectionMode = ConnectionMode.Direct, + MaxRequestsPerTcpConnection = maxRequestsPerConnection, }; // Act. @@ -275,8 +276,11 @@ .GetValue(loadBalancingPartition); Assert.IsNotNull(openChannels); - Assert.AreEqual(30, channelCapacity); - Assert.AreEqual(1, openChannels.Count); + Assert.AreEqual(48, openChannels.Count, "Here the expected value 48 rather explains how many time we call the" + + "LoadBalancingPartition.OpenChannelAsync(). The emulator by default returns 12 partitions, and each partition has 4 replicas," + + "and by behavior the emulator uses the same URI for eac of these replica, hence 12 * 4 = 48 times we call the OpenChannelAsync()." + + "In ideal world, the value should be 1, because for each unique URI, the OpenChannelAsync() call will just be 1."); + Assert.AreEqual(openChannels.Count * maxRequestsPerConnection, channelCapacity); Documents.Rntbd.LbChannelState channelState = openChannels.First(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index e5b95a7ed..7fde376d4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -6680,6 +6680,11 @@ "Attributes": [], "MethodInfo": "System.String GermanyWestCentral;IsInitOnly:False;IsStatic:True;" }, + "System.String IsraelCentral": { + "Type": "Field", + "Attributes": [], + "MethodInfo": "System.String IsraelCentral;IsInitOnly:False;IsStatic:True;" + }, "System.String ItalyNorth": { "Type": "Field", "Attributes": [],