-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Parallel and synchronized test execution for loadscraper.TestScrape #28877
Merged
dmitryax
merged 17 commits into
open-telemetry:main
from
michalpristas:fix/TestScrape-windows
Mar 30, 2024
Merged
Parallel and synchronized test execution for loadscraper.TestScrape #28877
dmitryax
merged 17 commits into
open-telemetry:main
from
michalpristas:fix/TestScrape-windows
Mar 30, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…tor-contrib into fix/TestScrape-windows
…ntelemetry-collector-contrib into fix/TestScrape-windows
hey @dmitryax pinging just not to let this PR die stale. ay feedback would be appreciated |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
dmitryax
added
Skip Changelog
PRs that do not require a CHANGELOG.md entry
and removed
Stale
labels
Mar 26, 2024
dmitryax
approved these changes
Mar 26, 2024
Hi @michalpristas , I'm sorry I missed the PR. It LGTM. Can you please rebase it? |
hey @dmitryax thanks for getting back. will rebase soon |
…ntelemetry-collector-contrib into fix/TestScrape-windows
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This is not a pretty refactor but I believe this is proper way to fix the test.
I was running into
0 is not lower than 0
error whenProcessor Queue Length
on my system was properly reported as 0.I added a special case not to fail in this case.
Then the main fix here is making test cases run in parallel as concurrent as possible.
Windows is special case when it comes to reporting CPU metrics as it uses sampling. This sampling is happening every 5 seconds.
While sampling it loads current load from counter and does 1/5/15 minutes average.
As tests are running sequentially, this current load can be different.
To work around this each test case is started in a goroutine while main test goroutine waits for all of them to start.
Each subtest waits for signal to start processing. This signal comes from main goroutine.
This way we achieve as close execution as possible. However there's no guarantee but it should be way more stable than it was.
To make test even more realistic, I changed sequencing frequency to 500 milliseconds in a test and let 3 seconds for scraper to do some actual work and not evaluate on a single scrape.
I ran more than 1200 consecutive executions without failure on my machine.
Link to tracking Issue: #10030
Testing: Unit test
Documentation: