-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add retries to tests relying on Http bin to improve test resiliency. #5692
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,10 @@ namespace Azure { namespace Core { namespace Test { | |
namespace _detail { | ||
constexpr static const char AzureSdkHttpbinServerSchema[] = "https"; | ||
constexpr static const char AzureSdkHttpbinServer[] = "azuresdkforcpp.azurewebsites.net"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this logic be moved into a single source rather than being defined in two different places? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that's a good suggestion. I will see how to remove the existing duplication here. |
||
|
||
// If we see intermittent test failures due to Httpbin reliability, even with a couple retries | ||
// we'd revisit the use of this for tests, rather than increasing retries. | ||
constexpr static const int AzureSdkHttpbinRetryCount = 2; | ||
} // namespace _detail | ||
|
||
struct AzureSdkHttpbinServer final | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these appear to be essentially identical. Is it possible to centralize this logic in a single function that encapsulates the retry logic and includes the test-specific behavior in a lambda?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to centralize the logic, but I prefer tests to be very simple/isolated and find the readability of lambdas a bit cognitively burdensome. If I can't find a simpler way to achieve that, will fall back to the lambda approach.