Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Internal] Direct Package Upgrade: Refactors Code to Bump Up Cosmos.Direct Package to 3.31.2 #3918

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ClientOfficialVersion>3.34.0</ClientOfficialVersion>
<ClientPreviewVersion>3.34.0</ClientPreviewVersion>
<ClientPreviewSuffixVersion>preview</ClientPreviewSuffixVersion>
<DirectVersion>3.31.1</DirectVersion>
<DirectVersion>3.31.2</DirectVersion>
kundadebdatta marked this conversation as resolved.
Show resolved Hide resolved
<EncryptionOfficialVersion>2.0.2</EncryptionOfficialVersion>
<EncryptionPreviewVersion>2.0.2</EncryptionPreviewVersion>
<EncryptionPreviewSuffixVersion>preview</EncryptionPreviewSuffixVersion>
Expand Down
5 changes: 5 additions & 0 deletions Microsoft.Azure.Cosmos/src/Regions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -359,5 +359,10 @@ public static class Regions
/// Name of the Azure Italy North region in the Azure Cosmos DB service.
/// </summary>
public const string ItalyNorth = "Italy North";

/// <summary>
/// Name of the Azure Israel Central region in the Azure Cosmos DB service.
/// </summary>
public const string IsraelCentral = "Israel Central";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public async Task InitializeContainersAsync_WhenThrowsException_ShouldDisposeCos
public async Task CreateAndInitializeAsync_WithValidDatabaseAndContainer_ShouldOpenRntbdConnectionsToBackendReplicas()
{
// Arrange.
int httpCallsMade = 0;
int httpCallsMade = 0, maxRequestsPerConnection = 6;
HttpClientHandlerHelper httpClientHandlerHelper = new ()
{
RequestCallBack = (request, cancellationToken) =>
Expand All @@ -227,6 +227,7 @@ public async Task CreateAndInitializeAsync_WithValidDatabaseAndContainer_ShouldO
{
HttpClientFactory = () => new HttpClient(httpClientHandlerHelper),
ConnectionMode = ConnectionMode.Direct,
MaxRequestsPerTcpConnection = maxRequestsPerConnection,
};

// Act.
Expand Down Expand Up @@ -275,8 +276,11 @@ public async Task CreateAndInitializeAsync_WithValidDatabaseAndContainer_ShouldO
.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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
Expand Down