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

scrape_test.go: Increase scrape interval in TestScrapeLoopCache to re… #13336

Merged
merged 1 commit into from Jan 18, 2024

Conversation

machine424
Copy link
Collaborator

…duce potential flakiness

fixes: #12727

@bboreham
Copy link
Member

Thanks; needs DCO.

Will this increase the test run time?

@machine424
Copy link
Collaborator Author

Will this increase the test run time?

Yep, it'll move from 0.04s to 0.4s in average.
Another solution would be to add a time.Sleep(2*time.Millisecond) to the scraper.scrapeFunc to make sure it isn't triggered at the same ms timestamp.

…duce potential flakiness

Signed-off-by: machine424 <ayoubmrini424@gmail.com>
@bboreham
Copy link
Member

How about we make this change only on the OSs where it is required? (Which I think is Windows)

@machine424
Copy link
Collaborator Author

machine424 commented Jan 12, 2024

How about we make this change only on the OSs where it is required? (Which I think is Windows)

I have the same issue on Mac actually.

I could exclude both of them if you want, and maybe wait for the test to fail on linux one day :)

@machine424
Copy link
Collaborator Author

There is also this hack:

Another solution would be to add a time.Sleep(2*time.Millisecond) to the scraper.scrapeFunc to make sure it isn't triggered at the same ms timestamp.

Which will not increase the runtime A LOT (given golang/go#44343)

(fun fact: we don't recommend using such small scrape intervals, but they're the ones we "test" the most so tests run faster, I don't know if parallelism may help to be able ti use larger intervals...)

Copy link
Member

@bboreham bboreham left a comment

Choose a reason for hiding this comment

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

OK let's move ahead with this and revisit if the extra fraction of a second is important.

@bboreham bboreham merged commit 4ad9b6d into prometheus:main Jan 18, 2024
24 checks passed
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 TestScrapeLoopCache
2 participants