Skip to content

Commit

Permalink
add retry to address flakiness (#419)
Browse files Browse the repository at this point in the history
Co-authored-by: Bryan Apellanes <[email protected]>
  • Loading branch information
bryanapellanes-okta and BryanApellanes authored Aug 20, 2020
1 parent 3a8cf61 commit c53be9c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Okta.Sdk.IntegrationTests/UserScenarios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -785,9 +785,15 @@ public async Task ForgotPasswordGenerateOneTimeToken()

try
{
var forgotPasswordResponse = await createdUser.ForgotPasswordGenerateOneTimeTokenAsync(false);
forgotPasswordResponse.Should().NotBeNull();
forgotPasswordResponse.ResetPasswordUrl.Should().NotBeNullOrEmpty();
var policy = Polly.Policy
.Handle<Exception>()
.WaitAndRetryAsync(4, attemptNumber => TimeSpan.FromSeconds(Math.Pow(5, attemptNumber - 1)))
.ExecuteAsync(async () =>
{
var forgotPasswordResponse = await createdUser.ForgotPasswordGenerateOneTimeTokenAsync(false);
forgotPasswordResponse.Should().NotBeNull();
forgotPasswordResponse.ResetPasswordUrl.Should().NotBeNullOrEmpty();
});
}
finally
{
Expand Down

0 comments on commit c53be9c

Please sign in to comment.