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

Try to make TestConstantArrivalRateRunCorrectRate less flaky #4546

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

mstoykov
Copy link
Contributor

What?

The test is testing how constant arrival rate is starting iterations over time. But it used time.Sleep of 1 second which means that it doesn't actually check every second it checks and then it waits for 1 second and then again.

This seems to move enough, especially on windows, that it sometimes fails.

This PR uses time.Ticker to make it check every second, making it more likely that it won't drift.

Why?

Flaky test bad

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (make lint) and all checks pass.
  • I have run tests locally (make tests) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Related PR(s)/Issue(s)

The test is testing how constant arrival rate is starting iterations
over time. But it used time.Sleep of 1 second which means that it
doesn't actually check every second it checks and then it waits for 1
second and then again.

This seems to move enough, especially on windows, that it sometimes
fails.

This PR uses time.Ticker to make it check every second, making it more
likely that it won't drift.
@mstoykov mstoykov added the tests label Feb 13, 2025
@mstoykov mstoykov added this to the v1.0.0-rc1 milestone Feb 13, 2025
@mstoykov mstoykov requested a review from a team as a code owner February 13, 2025 15:35
@mstoykov mstoykov requested review from codebien and olegbespalov and removed request for a team February 13, 2025 15:35
@mstoykov mstoykov merged commit ffdf89c into master Feb 14, 2025
28 checks passed
@mstoykov mstoykov deleted the TestConstantArrivalRateRunCorrectRateLessFlaky branch February 14, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants