Skip to content

Commit

Permalink
Reduce attempts to 3 and validate at least one passes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsonkhan authored Apr 16, 2024
1 parent aeb3817 commit 2c83fc6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sdk/core/azure-core/test/ut/transport_policy_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,10 @@ namespace Azure { namespace Core { namespace Test {
// Azure::Core::Url testUrl("https://www.microsoft.com/");
// HTTP Connections.
auto failedCounter = 0;
for (auto i = 0; i < 10; i++)
auto const attempts = 3;
for (auto i = 0; i < attempts; i++)
{
GTEST_LOG_(INFO) << "DisableCrlValidation test iteration " << i << ".";
try
{
Azure::Core::Http::Policies::TransportOptions transportOptions;
Expand All @@ -454,13 +456,15 @@ namespace Azure { namespace Core { namespace Test {
GTEST_LOG_(INFO) << "DisableCrlValidation test iteration " << i
<< " failed with a TransportException.";
failedCounter++;
// We allow 1 intermittent failure.
// We allow 1 intermittent failure, due to networking issues.
if (failedCounter > 1)
{
throw;
}
}
}
// We expect at least one of the three attempts to succeed.
EXPECT_LT(failedCounter, attempts);
#if defined(ENABLE_PROXY_TESTS)
if (IsSquidProxyRunning)
{
Expand Down

0 comments on commit 2c83fc6

Please sign in to comment.