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

tests(distributor): improve checks during ha_tracker sync cache on startup #9905

Merged

Conversation

NickAnge
Copy link
Contributor

@NickAnge NickAnge commented Nov 14, 2024

What this PR does

This PR updates the TestHATrackerCacheSyncOnStart to use the MockCountingClient that was introduced in dskit (Ref). This will allow us to better test if the sync happened during the ha_tracker creation

Follow up of this: #9826

Which issue(s) this PR fixes or relates to

Improve testing scenarios

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.

@NickAnge NickAnge changed the title tests: create a KV.Client to count calls of the GET and LIST operatio… tests(distributor): improve checks during ha_tracker sync cache on startup Nov 14, 2024
@56quarters
Copy link
Contributor

The dskit library has an existing "mock" kv.Client implementation. This seems like a good fit to live there. Specific to the code here, each count should be separate atomic variable using either the Uber lib or stdlib (whichever we use elsewhere in dskit).

Copy link
Contributor

@dimitarvdimitrov dimitarvdimitrov left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@dimitarvdimitrov dimitarvdimitrov dismissed their stale review November 14, 2024 15:46

I didn't see Nick's comment before approving. His suggestion makes sense to me 👍

@NickAnge NickAnge force-pushed the nickange/ha_tracker/improve-testing-sync-cache-onstartup branch from c3e856e to 7febb63 Compare November 15, 2024 08:58
@NickAnge NickAnge marked this pull request as ready for review November 15, 2024 09:14
@NickAnge NickAnge requested review from stevesg, grafanabot and a team as code owners November 15, 2024 09:14
@dimitarvdimitrov dimitarvdimitrov merged commit 6f668ee into main Nov 18, 2024
29 checks passed
@dimitarvdimitrov dimitarvdimitrov deleted the nickange/ha_tracker/improve-testing-sync-cache-onstartup branch November 18, 2024 09:03
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