Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

ahsonkhan
Copy link
Member

Address a class of intermittent test failures due to transient failures caused by the reliability of http bin.

The issues below have more detail on the intermittent nature of the tests.

Fixes:
#5652
#5006
#4634
#5493

Similar fix to #5537

@ahsonkhan ahsonkhan added Azure.Core test-reliability Issue that causes tests to be unreliable labels Jun 5, 2024
@ahsonkhan ahsonkhan self-assigned this Jun 5, 2024
// is still flagged as shutdown.
auto session
= std::make_unique<Azure::Core::Http::CurlSession>(req, std::move(connection), options);
GTEST_LOG_(INFO) << "forceConnectionClosed test iteration " << i << ".";
Copy link
Member

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?

Copy link
Member Author

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.

@@ -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";
Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Member Author

Choose a reason for hiding this comment

The 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.

Copy link

github-actions bot commented Aug 9, 2024

Hi @ahsonkhan. Thank you for your interest in helping to improve the Azure SDK experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days.

@github-actions github-actions bot added the no-recent-activity There has been no recent activity on this issue. label Aug 9, 2024
Copy link

Hi @ahsonkhan. Thank you for your contribution. Since there hasn't been recent engagement, we're going to close this out. Feel free to respond with a comment containing /reopen if you'd like to continue working on these changes. Please be sure to use the command to reopen or remove the no-recent-activity label; otherwise, this is likely to be closed again with the next cleanup pass.

@github-actions github-actions bot closed this Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Core no-recent-activity There has been no recent activity on this issue. test-reliability Issue that causes tests to be unreliable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants