From d30e7afe1039d362043bf280d91efcb994e5599d Mon Sep 17 00:00:00 2001 From: philipthomas Date: Fri, 16 Aug 2024 11:14:18 -0400 Subject: [PATCH] static qualifier in tests --- .../CFP/AllVersionsAndDeletes/BuilderTests.cs | 14 +++++++------- .../BuilderWithCustomSerializerTests.cs | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderTests.cs index 6ebfd0f8ed..669c6bd194 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderTests.cs @@ -121,7 +121,7 @@ public async Task WhenADocumentIsCreatedWithTtlSetThenTheDocumentIsDeletedTestsA try { - await Task.Delay(ChangeFeedSetupTime); + await Task.Delay(BaseChangeFeedClientHelper.ChangeFeedSetupTime); await monitoredContainer.CreateItemAsync(new ToDoActivity { id = "1", pk = "1", description = "Testing TTL on CFP.", ttl = ttlInSeconds }, partitionKey: new PartitionKey("1")); // NOTE(philipthomas-MSFT): Please allow these Logger.LogLine because TTL on items will purge at random times so I am using this to test when ran locally using emulator. @@ -239,7 +239,7 @@ public async Task WhenADocumentIsCreatedThenUpdatedThenDeletedTestsAsync() // 1 second delay between operations to get different timestamps. await processor.StartAsync(); - await Task.Delay(ChangeFeedSetupTime); + await Task.Delay(BaseChangeFeedClientHelper.ChangeFeedSetupTime); await monitoredContainer.CreateItemAsync(new { id = "1", pk = "1", description = "original test" }, partitionKey: new PartitionKey("1")); await Task.Delay(1000); @@ -249,7 +249,7 @@ public async Task WhenADocumentIsCreatedThenUpdatedThenDeletedTestsAsync() await monitoredContainer.DeleteItemAsync(id: "1", partitionKey: new PartitionKey("1")); - bool isStartOk = allDocsProcessed.WaitOne(10 * ChangeFeedSetupTime); + bool isStartOk = allDocsProcessed.WaitOne(10 * BaseChangeFeedClientHelper.ChangeFeedSetupTime); await processor.StopAsync(); @@ -531,8 +531,8 @@ private static async Task BuildChangeFeedProcessorWithLatestVersionAsync( Interlocked.Exchange(ref latestVersionProcessorAtomic, processor); await processor.StartAsync(); - await Task.Delay(ChangeFeedSetupTime); - bool isStartOk = allDocsProcessed.WaitOne(10 * ChangeFeedSetupTime); + await Task.Delay(BaseChangeFeedClientHelper.ChangeFeedSetupTime); + bool isStartOk = allDocsProcessed.WaitOne(10 * BaseChangeFeedClientHelper.ChangeFeedSetupTime); if (exception != default) { @@ -564,8 +564,8 @@ private static async Task BuildChangeFeedProcessorWithAllVersionsAndDeletesAsync Interlocked.Exchange(ref allVersionsAndDeletesProcessorAtomic, processor); await processor.StartAsync(); - await Task.Delay(ChangeFeedSetupTime); - bool isStartOk = allDocsProcessed.WaitOne(10 * ChangeFeedSetupTime); + await Task.Delay(BaseChangeFeedClientHelper.ChangeFeedSetupTime); + bool isStartOk = allDocsProcessed.WaitOne(10 * BaseChangeFeedClientHelper.ChangeFeedSetupTime); if (exception != default) { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderWithCustomSerializerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderWithCustomSerializerTests.cs index 92d5ad1eb8..c866f6220a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderWithCustomSerializerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CFP/AllVersionsAndDeletes/BuilderWithCustomSerializerTests.cs @@ -453,7 +453,7 @@ public async Task WhenADocumentIsCreatedWithTtlSetThenTheDocumentIsDeletedTestsA try { - await Task.Delay(ChangeFeedSetupTime); + await Task.Delay(BaseChangeFeedClientHelper.ChangeFeedSetupTime); await monitoredContainer.CreateItemAsync(new ToDoActivity { id = "1", pk = "1", description = "Testing TTL on CFP.", ttl = ttlInSeconds }, partitionKey: new PartitionKey("1")); // NOTE(philipthomas-MSFT): Please allow these Logger.LogLine because TTL on items will purge at random times so I am using this to test when ran locally using emulator. @@ -571,7 +571,7 @@ public async Task WhenADocumentIsCreatedThenUpdatedThenDeletedTestsAsync() // 1 second delay between operations to get different timestamps. await processor.StartAsync(); - await Task.Delay(ChangeFeedSetupTime); + await Task.Delay(BaseChangeFeedClientHelper.ChangeFeedSetupTime); await monitoredContainer.CreateItemAsync(new ToDoActivity { id = "1", pk = "1", description = "original test", ttl = -1 }, partitionKey: new PartitionKey("1")); await Task.Delay(1000); @@ -581,7 +581,7 @@ public async Task WhenADocumentIsCreatedThenUpdatedThenDeletedTestsAsync() await monitoredContainer.DeleteItemAsync(id: "1", partitionKey: new PartitionKey("1")); - bool isStartOk = allDocsProcessed.WaitOne(10 * ChangeFeedSetupTime); + bool isStartOk = allDocsProcessed.WaitOne(10 * BaseChangeFeedClientHelper.ChangeFeedSetupTime); await processor.StopAsync(); @@ -658,8 +658,8 @@ private static async Task BuildChangeFeedProcessorWithLatestVersionAsync( Interlocked.Exchange(ref latestVersionProcessorAtomic, processor); await processor.StartAsync(); - await Task.Delay(ChangeFeedSetupTime); - bool isStartOk = allDocsProcessed.WaitOne(10 * ChangeFeedSetupTime); + await Task.Delay(BaseChangeFeedClientHelper.ChangeFeedSetupTime); + bool isStartOk = allDocsProcessed.WaitOne(10 * BaseChangeFeedClientHelper.ChangeFeedSetupTime); if (exception != default) { @@ -691,8 +691,8 @@ private static async Task BuildChangeFeedProcessorWithAllVersionsAndDeletesAsync Interlocked.Exchange(ref allVersionsAndDeletesProcessorAtomic, processor); await processor.StartAsync(); - await Task.Delay(ChangeFeedSetupTime); - bool isStartOk = allDocsProcessed.WaitOne(10 * ChangeFeedSetupTime); + await Task.Delay(BaseChangeFeedClientHelper.ChangeFeedSetupTime); + bool isStartOk = allDocsProcessed.WaitOne(10 * BaseChangeFeedClientHelper.ChangeFeedSetupTime); if (exception != default) {