Skip to content

flake: TestInflightDispatchesMetric #109

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

Closed
spikecurtis opened this issue Oct 16, 2024 · 0 comments · Fixed by coder/coder#15107
Closed

flake: TestInflightDispatchesMetric #109

spikecurtis opened this issue Oct 16, 2024 · 0 comments · Fixed by coder/coder#15107
Assignees
Labels

Comments

@spikecurtis
Copy link

    metrics_test.go:342: 
        	Error Trace:	/home/runner/work/coder/coder/coderd/notifications/metrics_test.go:342
        	Error:      	Condition never satisfied
        	Test:       	TestInflightDispatchesMetric

seen here: https://github.com/coder/coder/actions/runs/11363823264/job/31608588543

@spikecurtis spikecurtis self-assigned this Oct 16, 2024
@coder-labeler coder-labeler bot added the tests label Oct 16, 2024
@matifali matifali removed the tests label Oct 16, 2024
spikecurtis added a commit to coder/coder that referenced this issue Oct 21, 2024
In investigating coder/internal#109 I noticed many of the notification tests are still using `time.Sleep` and `require.Eventually`. This is an initial effort to start converting these to Quartz.

One product change is to switch the `notifier` to use a `TickerFunc` instead of a normal Ticker, since it allows the test to assert that a batch process is complete via the Quartz `Mock` clock.  This does introduce one slight behavioral change in that the notifier waits the fetch interval before processing its first batch.  In practice, this is inconsequential: no one will notice if we send notifications immediately on startup, or just a little later.

But, it does make a difference to some tests, which are fixed up here.
defelmnq pushed a commit to coder/coder that referenced this issue Oct 23, 2024
In investigating coder/internal#109 I noticed many of the notification tests are still using `time.Sleep` and `require.Eventually`. This is an initial effort to start converting these to Quartz.

One product change is to switch the `notifier` to use a `TickerFunc` instead of a normal Ticker, since it allows the test to assert that a batch process is complete via the Quartz `Mock` clock.  This does introduce one slight behavioral change in that the notifier waits the fetch interval before processing its first batch.  In practice, this is inconsequential: no one will notice if we send notifications immediately on startup, or just a little later.

But, it does make a difference to some tests, which are fixed up here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants