elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.49k stars 8.05k forks source link

Adding a more flexible retry function to the retryService #178535

Open maryam-saeidi opened 4 months ago

maryam-saeidi commented 4 months ago

Summary

In this PR, the security team (@jpdjere) added a retry utility that is very flexible and it accepts parameters such as:

I copied this utility to our observability API integration tests, and I did some adjustment regarding logging as we don't need to have error logs in case of a failure attempt (I prefer the logging that we have in retryService instead.)

I think it would be good to have this code shared between different tests, either in a package or maybe moving it to the retryService itself.

The end goal is to have this functionality shared between tests and replace all the instances of pRetry with this utility instead: (Second item in the description of this PR)

Before After
image image
elasticmachine commented 4 months ago

Pinging @elastic/appex-qa (Team:QA)

dmlemeshko commented 4 months ago

I agree it is a useful improvement. I also think that having retry capabilities within single service is easy to support and re-use across different tests in the long run, opened #178660

maryam-saeidi commented 3 months ago

@dmlemeshko Shall we close this ticket? I think you covered it in your PR, right?