Skip to content

Commit

Permalink
static qualifier in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
philipthomas-MSFT committed Aug 16, 2024
1 parent d71b8b0 commit d30e7af
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public async Task WhenADocumentIsCreatedWithTtlSetThenTheDocumentIsDeletedTestsA

try
{
await Task.Delay(ChangeFeedSetupTime);
await Task.Delay(BaseChangeFeedClientHelper.ChangeFeedSetupTime);
await monitoredContainer.CreateItemAsync<ToDoActivity>(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.
Expand Down Expand Up @@ -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<dynamic>(new { id = "1", pk = "1", description = "original test" }, partitionKey: new PartitionKey("1"));
await Task.Delay(1000);
Expand All @@ -249,7 +249,7 @@ public async Task WhenADocumentIsCreatedThenUpdatedThenDeletedTestsAsync()

await monitoredContainer.DeleteItemAsync<dynamic>(id: "1", partitionKey: new PartitionKey("1"));

bool isStartOk = allDocsProcessed.WaitOne(10 * ChangeFeedSetupTime);
bool isStartOk = allDocsProcessed.WaitOne(10 * BaseChangeFeedClientHelper.ChangeFeedSetupTime);

await processor.StopAsync();

Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ public async Task WhenADocumentIsCreatedWithTtlSetThenTheDocumentIsDeletedTestsA

try
{
await Task.Delay(ChangeFeedSetupTime);
await Task.Delay(BaseChangeFeedClientHelper.ChangeFeedSetupTime);
await monitoredContainer.CreateItemAsync<ToDoActivity>(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.
Expand Down Expand Up @@ -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<ToDoActivity>(new ToDoActivity { id = "1", pk = "1", description = "original test", ttl = -1 }, partitionKey: new PartitionKey("1"));
await Task.Delay(1000);
Expand All @@ -581,7 +581,7 @@ public async Task WhenADocumentIsCreatedThenUpdatedThenDeletedTestsAsync()

await monitoredContainer.DeleteItemAsync<ToDoActivity>(id: "1", partitionKey: new PartitionKey("1"));

bool isStartOk = allDocsProcessed.WaitOne(10 * ChangeFeedSetupTime);
bool isStartOk = allDocsProcessed.WaitOne(10 * BaseChangeFeedClientHelper.ChangeFeedSetupTime);

await processor.StopAsync();

Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit d30e7af

Please sign in to comment.