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

TestIngester_PushToStorage_CircuitBreaker: increase initial delay #9351

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dimitarvdimitrov
Copy link
Contributor

What this PR does

I believe there's a race between sending the first request and then collecting the metrics. It's possible that we collect the metrics longer than 200ms after the first request, at which point the CB has opened. I could reproduce #9052 by reducing the initialDelay to 10ms.

This PR increases it to 1 hour so that we're more sure that the delay hasn't expired when we're collecting the metrics.

Which issue(s) this PR fixes or relates to

Fixes #9052

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • about-versioning.md updated with experimental features.

Fixes XXX
I believe there's a race between sending the first request and then collecting the metrics. It's possible that we collect the metrics longer than 200ms after the first request, at which point the CB has opened. I could reproduce XXX by reducing the initialDelay to 10ms.

This PR increases it to 1 hour so that we're more sure that the delay hasn't expired when we're collecting the metrics.

Signed-off-by: Dimitar Dimitrov <[email protected]>
@dimitarvdimitrov dimitarvdimitrov requested a review from a team as a code owner September 20, 2024 11:18
Copy link
Contributor

@narqo narqo left a comment

Choose a reason for hiding this comment

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

Works for me. Although, I still don't fully understand what does the case of initialDelayEnabled tests.

Note also the comment about another one to update.

Comment on lines 457 to 459
if initialDelayEnabled {
initialDelay = 200 * time.Millisecond
initialDelay = time.Hour
}
Copy link
Contributor

Choose a reason for hiding this comment

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

There is also TestIngester_Push_CircuitBreaker_DeadlineExceeded down there, which uses the same test pattern, where initialDelay = 200 * time.Millisecond. Should we, maybe, update it also, to keep the tests consistent. Otherwise, it makes it even more complicated to follow what those tests are actually testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah probably. I think one uses ingest storage, the other one doesn't

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pushed this a299bcd

@dimitarvdimitrov
Copy link
Contributor Author

Although, I still don't fully understand what does the case of initialDelayEnabled tests.

I think it basically checks that the CB doesn't open for the first N seconds after a failure. If I was writing it, I'd probably then assert that the CB does open eventually; right now we just assert it stays closed

Signed-off-by: Dimitar Dimitrov <[email protected]>
Copy link
Contributor

@narqo narqo left a comment

Choose a reason for hiding this comment

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

It's even better now 🔥🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky TestIngester_PushToStorage_CircuitBreaker
2 participants