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

distributor: Increase test polling duration to allow the cache suffic… #10364

Merged

Conversation

NickAnge
Copy link
Contributor

@NickAnge NickAnge commented Jan 7, 2025

Successfully reproduced the flakiness after running:

go test -v -failfast ./pkg/distributor/ -run TestHaTrackerWithMemberList -count=100000

The checkReplicaTimestamp function includes a duration parameter, after which it stops retrying to check if the value in the cache has been updated. This issue is rare, but in some edge cases, the time can exceed the previous 1-second limit. To minimize the likelihood of this happening, I have doubled the duration.

I re-run the above command and it didn't happen.

What this PR does

Which issue(s) this PR fixes or relates to

Fixes #10350

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 marked this pull request as ready for review January 7, 2025 08:54
@NickAnge NickAnge requested a review from a team as a code owner January 7, 2025 08:54
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.

checkReplicaTimestamp has 21 usages and all of them used to use time.Second. Should we update all of them? Do you think we can just remove the duration argument and hardcode 2*time.Second into checkReplicaTimestamp?

@NickAnge
Copy link
Contributor Author

NickAnge commented Jan 7, 2025

checkReplicaTimestamp has 21 usages and all of them used to use time.Second. Should we update all of them? Do you think we can just remove the duration argument and hardcode 2*time.Second into checkReplicaTimestamp?

I wouldn’t remove the argument, as it provides flexibility in case more time is needed to apply the poll during testing. However, I agree that increasing it to 2time.Second is an improvement, as it will prevent failures if more time is required for the cache to update. I believe 2 seconds should be more than sufficient. Let me know what you think. In the meantime I apply the 2timeSecond to every occurrence

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.

Yeah that works too. LGTM!

@dimitarvdimitrov dimitarvdimitrov enabled auto-merge (squash) January 9, 2025 07:39
@dimitarvdimitrov dimitarvdimitrov merged commit 33ca7b5 into main Jan 9, 2025
29 checks passed
@dimitarvdimitrov dimitarvdimitrov deleted the nickange/ha_tracker/test/increase-test-poll-duration branch January 9, 2025 07:45
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 TestHaTrackerWithMemberList
2 participants