- Notifications
You must be signed in to change notification settings - Fork1k
test: fix flake, TestLabelsAggregation update & collect timing#19654
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
// This code makes sure all updates are processed before we start a collection. | ||
// We do this by grepping the logs for "update metrics" messages, which are logged | ||
// every time an update is processed. | ||
// | ||
// This is not ideal as the code relies on implementation details (the log message), | ||
require.Eventually(t,func()bool { | ||
returnstrings.Count(updateWatch.String(),"update metrics")==len(tc.given) | ||
},testutil.WaitMedium,testutil.IntervalFast) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is a really unfortunate fix. There is no way to hook into the timing. Maybe with quartz?
The issue istime.Now()
is called before the channel enqueue. So to do this with quartz, we would need to add some othertime.Now()
function in the update select case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This may need to be some kind of buffer protected by a mutex, or perhaps a buffered channel instead?
ethanndickson commentedSep 2, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Steven's on PTO, and I'm pretty sure I fixed this in#19599, feel free to reopen if it comes back. |
If you see the logs, the
collect
happens before theupdate metrics