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

Replace benbjohnson/clock with coder/quartz #4001

Conversation

grobinson-grafana
Copy link
Contributor

This commit replaces the archived and no longer maintained benbjohnson/clock package with coder/quartz. It is one of two pull requests. This pull request updates the silence package.

clock.Add(1 * time.Second)
require.EqualValues(t, 1, calls.Load())
clock.Advance(1 * time.Second)
require.Eventually(t, func() bool { return calls.Load() == 1 }, 5*time.Second, time.Second)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is now required as otherwise the require.EqualValues is run before the goroutine. This didn't happen with benbjohnson/clock as it included additional synchronization code to ensure all timers fired before clock.Add returned. This made tests easier to write, but is not how the time package behaves in real life.

This commit replaces the archived and no longer maintained
benbjohnson/clock package with coder/quartz.

Signed-off-by: George Robinson <[email protected]>
@grobinson-grafana grobinson-grafana force-pushed the grobinson/replace-clock-with-quartz-1 branch from 55907cb to d9c82e7 Compare August 27, 2024 11:12
Copy link
Member

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

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

Thanks!

@simonpasquier simonpasquier merged commit 0df909a into prometheus:main Aug 29, 2024
11 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.

2 participants