Skip to content

Commit

Permalink
tests(Compute): Adjust concurrent retries.
Browse files Browse the repository at this point in the history
  • Loading branch information
amanda-tarafa committed Sep 9, 2021
1 parent d229288 commit adbd40e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion compute/api/Compute.Samples.Tests/ComputeFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,14 @@ public class ComputeFixture : IDisposable, ICollectionFixture<ComputeFixture>

private StorageClient StorageClient { get; } = StorageClient.Create();

public RetryRobot Assert { get; } = new RetryRobot { RetryWhenExceptions = new Type[] { typeof(XunitException) } };
public RetryRobot AssertConcurrently { get; } = new RetryRobot
{
RetryWhenExceptions = new Type[] { typeof(XunitException) },
// We wait a little longer than default to let the concurrent test execution
// finish before reattempting.
FirstRetryDelayMs = 30_000,
MaxTryCount = 10
};

public ComputeFixture()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class DisableUsageExportBucketAsyncTest
[Fact]
public async Task DisablesUsageExportBucket()
{
await _fixture.Assert.Eventually(async () =>
await _fixture.AssertConcurrently.Eventually(async () =>
{
await _sample.DisableUsageExportBucketAsync(_fixture.ProjectId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class SetUsageExportBucketAsyncTest
[Fact]
public async Task SetsUsageExportBucket()
{
await _fixture.Assert.Eventually(async () =>
await _fixture.AssertConcurrently.Eventually(async () =>
{
await _sample.SetUsageExportBucketAsync(_fixture.ProjectId, _fixture.UsageReportBucketName, _fixture.UsageReportPrefix);
Expand Down

0 comments on commit adbd40e

Please sign in to comment.