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

Integration Testing Framework: Add retries for artifacts API call #4348

Merged
merged 8 commits into from
Mar 4, 2024

Conversation

ycombinator
Copy link
Contributor

@ycombinator ycombinator commented Feb 29, 2024

What does this PR do?

This PR adds retries to the Artifacts API call in the integration testing framework, as recommended by @DaveSys911.

Why is it important?

The Artifacts API can sometimes be flaky.

Related issues

@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

Copy link
Contributor

mergify bot commented Feb 29, 2024

This pull request does not have a backport label. Could you fix it @ycombinator? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@ycombinator ycombinator added backport-v8.13.0 Automated backport with mergify and removed backport-skip labels Feb 29, 2024
@pierrehilbert pierrehilbert requested a review from rdner February 29, 2024 16:17
@ycombinator ycombinator force-pushed the testing-artifacts-api-retries branch 2 times, most recently from e12ace2 to e7af558 Compare February 29, 2024 16:29
@ycombinator ycombinator force-pushed the testing-artifacts-api-retries branch from e7af558 to 0805f66 Compare February 29, 2024 16:47
@ycombinator
Copy link
Contributor Author

Moving PR into draft to a) update unit test assertions and b) refactor logging logic so logger doesn't need to be passed down in several places.

@ycombinator ycombinator marked this pull request as draft March 1, 2024 01:08
@ycombinator ycombinator marked this pull request as ready for review March 4, 2024 16:35
@ycombinator ycombinator requested a review from pchila March 4, 2024 16:36
@ycombinator ycombinator force-pushed the testing-artifacts-api-retries branch from adf118f to 6306b23 Compare March 4, 2024 17:17
Copy link

Quality Gate passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No Coverage information No data about Coverage
0.0% 0.0% Duplication on New Code

See analysis details on SonarQube

@ycombinator ycombinator merged commit 94c7d88 into elastic:main Mar 4, 2024
9 checks passed
@ycombinator ycombinator deleted the testing-artifacts-api-retries branch March 4, 2024 23:48
mergify bot pushed a commit that referenced this pull request Mar 4, 2024
)

* Add retries for artifacts API call

* Add newline

* Adding logging

* Pass logger in constructor

* Add missing arg

* Fix logic for happy path

* Adding comment

* Do not keep retrying if request context was cancelled or timed out

(cherry picked from commit 94c7d88)
Copy link
Member

@rdner rdner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ycombinator Unfortunately, I didn't look at this PR in time. Sorry about that.

I don't think this is how we should approach it, we should:

  1. Implement the httpDoer interface with retries and use this implementation as an option
  2. Continue using the existing option pattern and remove the logger parameter.
  3. The logger interface is not implemented by any logger, only by testing.T and this client is used beyond testing.

I addressed 2 and 3 in my PR #4331 (had to resolve some conflicts)

For 1 @pchila filed an issue here #4354

ycombinator added a commit that referenced this pull request Mar 7, 2024
)

* Add retries for artifacts API call

* Add newline

* Adding logging

* Pass logger in constructor

* Add missing arg

* Fix logic for happy path

* Adding comment

* Do not keep retrying if request context was cancelled or timed out

(cherry picked from commit 94c7d88)
ycombinator added a commit that referenced this pull request Mar 7, 2024
) (#4353)

* Add retries for artifacts API call

* Add newline

* Adding logging

* Pass logger in constructor

* Add missing arg

* Fix logic for happy path

* Adding comment

* Do not keep retrying if request context was cancelled or timed out

(cherry picked from commit 94c7d88)

Co-authored-by: Shaunak Kashyap <ycombinator@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.13.0 Automated backport with mergify skip-changelog Team:Elastic-Agent Label for the Agent team Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integration Testing Framework: Add retries to Artifacts API call
4 participants