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

Finish replacing benbjohnson/clock with coder/quartz #4002

Conversation

grobinson-grafana
Copy link
Contributor

This commit finishes replacing benbjohnson/clock with coder/quartz and removes it from go.mod. It is stacked on top of #4001.

clock.Add(1 * time.Millisecond)
require.EqualValues(t, 1, calls.Load())
clock.Advance(1 * time.Millisecond)
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.

@grobinson-grafana grobinson-grafana force-pushed the grobinson/replace-clock-with-quartz-2 branch from 182a9ff to 1cc53cc Compare August 27, 2024 11:13
This commit finishes replacing benbjohnson/clock with coder/quartz
and removes it from go.mod.

Signed-off-by: George Robinson <[email protected]>
@grobinson-grafana grobinson-grafana force-pushed the grobinson/replace-clock-with-quartz-2 branch from 1cc53cc to 1a30ee2 Compare August 29, 2024 09:02
Copy link
Member

@gotjosh gotjosh left a comment

Choose a reason for hiding this comment

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

LGTM

@gotjosh gotjosh merged commit 3d66826 into prometheus:main Oct 22, 2024
11 checks passed
mogoll92 pushed a commit to staketown/alertmanager that referenced this pull request Oct 23, 2024
This commit finishes replacing benbjohnson/clock with coder/quartz
and removes it from go.mod.

Signed-off-by: George Robinson <[email protected]>
mogoll92 added a commit to staketown/alertmanager that referenced this pull request Oct 23, 2024
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