Skip to content

fix: remove TestPendingUpdatesMetric flake #13944

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

Merged
merged 1 commit into from
Jul 19, 2024
Merged

fix: remove TestPendingUpdatesMetric flake #13944

merged 1 commit into from
Jul 19, 2024

Conversation

dannykopping
Copy link
Contributor

Fixes #13943.

I suspect my usage of sync.Cond was either wrong, naïve, or there's some behaviour in the runtime which is not as predictable as I'm expecting. I've changed to using a channel, which is simpler and what I should've done from the start.

I was able to provoke the flake reliably by running the following command, and with the fix I am not able to reproduce.
I don't 100% understand what causes the flake, but I'm fairly sure it's to do with the magic of sync.Cond.

$ go test -race -count=1000 -failfast ./coderd/notifications/... -run '^TestPendingUpdatesMetric$'
?       github.com/coder/coder/v2/coderd/notifications/types    [no test files]
ok      github.com/coder/coder/v2/coderd/notifications  155.644s
ok      github.com/coder/coder/v2/coderd/notifications/dispatch 2.585s [no tests to run]
ok      github.com/coder/coder/v2/coderd/notifications/render   1.647s [no tests to run]

Signed-off-by: Danny Kopping <danny@coder.com>
@dannykopping dannykopping requested a review from mtojek July 19, 2024 09:45
@dannykopping dannykopping changed the title fix: TestPendingUpdatesMetric flake fix TestPendingUpdatesMetric flake Jul 19, 2024
@dannykopping dannykopping changed the title fix TestPendingUpdatesMetric flake fix: remove TestPendingUpdatesMetric flake Jul 19, 2024
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

Let's give it a try 👍

@dannykopping dannykopping merged commit c88e416 into main Jul 19, 2024
36 checks passed
@dannykopping dannykopping deleted the dk/flake branch July 19, 2024 10:54
@github-actions github-actions bot locked and limited conversation to collaborators Jul 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flake: TestPendingUpdatesMetric
2 participants