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

Faster tests using the mocked consul in-memory backend #624

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

pracucci
Copy link
Contributor

@pracucci pracucci commented Dec 3, 2024

What this PR does:

I was investigating some slow unit tests in Mimir and I noticed they're slow because of the slow long polling done by WatchKey() on the mocked consul in-memory backend. In cortexproject/cortex#2078 I introduced mockedMaxWaitTime() to have faster tests. In this PR I propose to further reduce the max wait interval to 100ms. To get faster tests we also have to increase the m.cond.Broadcast() frequency too (done in this PR too).

Which issue(s) this PR fixes:

N/A

Checklist

  • Tests updated
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@pracucci pracucci merged commit 9973fac into main Dec 4, 2024
5 checks passed
@pracucci pracucci deleted the faster-ring-tests branch December 4, 2024 17:22
@dimitarvdimitrov
Copy link
Contributor

❤️ i wanted to do something like this in #519, but eventually gave up

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.

3 participants