Skip to content

Commit a8ced33

Browse files
committed
update test to use environment var
1 parent 3aa265f commit a8ced33

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

tests/aws-cpp-sdk-core-tests/aws/client/RetryBehaviorTest.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
#include <aws/testing/AwsCppSdkGTestSuite.h>
7+
#include <aws/testing/platform/PlatformTesting.h>
78
#include <aws/core/client/AWSError.h>
89
#include <aws/core/client/CoreErrors.h>
910
#include <aws/core/client/RetryStrategy.h>
@@ -55,6 +56,7 @@ class TestThrottleBasedQuotaContainer : public RetryQuotaContainer
5556

5657
class RetryBehaviorTest : public Aws::Testing::AwsCppSdkGTestSuite
5758
{
59+
Aws::Environment::EnvironmentRAII m_env{{{"AWS_NEW_RETRIES_2026", "true"}}};
5860
};
5961

6062
static AWSError<CoreErrors> MakeTransientError()
@@ -376,8 +378,13 @@ TEST_F(RetryBehaviorTest, InvalidRetryAfterFallsBack)
376378
ASSERT_LE(delay, 50);
377379
}
378380

381+
class RetryBehaviorLegacyTest : public Aws::Testing::AwsCppSdkGTestSuite
382+
{
383+
Aws::Environment::EnvironmentRAII m_env{{{"AWS_NEW_RETRIES_2026", ""}}};
384+
};
385+
379386
// Verify legacy behavior unchanged when gate is off (old constructors)
380-
TEST_F(RetryBehaviorTest, LegacyBehaviorUnchanged)
387+
TEST_F(RetryBehaviorLegacyTest, LegacyBehaviorUnchanged)
381388
{
382389
StandardRetryStrategy strategy(3);
383390

@@ -412,7 +419,7 @@ TEST_F(RetryBehaviorTest, ThrottleBasedClassification)
412419
}
413420

414421
// Verify legacy classification: REQUEST_TIMEOUT costs 10, others cost 5
415-
TEST_F(RetryBehaviorTest, LegacyClassification)
422+
TEST_F(RetryBehaviorLegacyTest, LegacyClassification)
416423
{
417424
DefaultRetryQuotaContainer quota;
418425

0 commit comments

Comments
 (0)