Skip to content

Commit 84553ec

Browse files
ChangeFeed tests: Isolates env-var state with test initialize cleanup
Agent-Logs-Url: https://github.com/Azure/azure-cosmos-dotnet-v3/sessions/2ecc1c73-658a-4358-ad20-9ecc87fb25fe Co-authored-by: kirankumarkolli <6880899+kirankumarkolli@users.noreply.github.com>
1 parent 537a24c commit 84553ec

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/DocumentServiceLeaseManagerCosmosTests.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ namespace Microsoft.Azure.Cosmos.ChangeFeed.Tests
2020
[TestCategory("ChangeFeed")]
2121
public class DocumentServiceLeaseManagerCosmosTests
2222
{
23+
[TestInitialize]
24+
public void TestInitialize()
25+
{
26+
Environment.SetEnvironmentVariable(ConfigurationManager.ChangeFeedLeaseIdAsPartitionKeyEnabled, null);
27+
}
28+
2329
[TestCleanup]
2430
public void TestCleanup()
2531
{
@@ -77,8 +83,6 @@ public async Task AcquireCompletes()
7783
[DataRow(2, DisplayName = "Container with partitionKey PK")]
7884
public async Task CreatesEPKBasedLease(int factoryType)
7985
{
80-
Environment.SetEnvironmentVariable(ConfigurationManager.ChangeFeedLeaseIdAsPartitionKeyEnabled, "true");
81-
8286
RequestOptionsFactory requestOptionsFactory = GetRequestOptionsFactory(factoryType);
8387
string continuation = Guid.NewGuid().ToString();
8488
DocumentServiceLeaseStoreManagerOptions options = new DocumentServiceLeaseStoreManagerOptions
@@ -121,8 +125,6 @@ public async Task CreatesEPKBasedLease(int factoryType)
121125
[DataRow(2, DisplayName = "Container with partitionKey PK")]
122126
public async Task CreatesPartitionKeyBasedLease(int factoryType)
123127
{
124-
Environment.SetEnvironmentVariable(ConfigurationManager.ChangeFeedLeaseIdAsPartitionKeyEnabled, "true");
125-
126128
RequestOptionsFactory requestOptionsFactory = GetRequestOptionsFactory(factoryType);
127129
string continuation = Guid.NewGuid().ToString();
128130
DocumentServiceLeaseStoreManagerOptions options = new DocumentServiceLeaseStoreManagerOptions

0 commit comments

Comments
 (0)