Skip to content

test: use barrier in TestInflightDispatchesMetric #15107

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
Oct 16, 2024
Merged

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Oct 16, 2024

Fixes: coder/internal#109

Spotted in: https://github.com/coder/coder/actions/runs/11363823264/job/31608588543

It seems that notification messages are successfully dispatched before the test runner starts checking if they are in-flight (flaky).

    t.go:99: 2024-10-16 10:33:05.385 [info]  coderd.manager.notifier: started  notifier_id=c502e78d-19a4-45d9-9368-f08da485d5be
    t.go:99: 2024-10-16 10:33:05.385 [debu]  coderd.manager.notifier: dequeued messages  notifier_id=c502e78d-19a4-45d9-9368-f08da485d5be  count=2
...
    t.go:99: 2024-10-16 10:33:05.671 [debu]  coderd.manager.notifier: batch completed  notifier_id=c502e78d-19a4-45d9-9368-f08da485d5be  count=2
    t.go:99: 2024-10-16 10:33:05.672 [debu]  coderd.manager.notifier: dequeued messages  notifier_id=c502e78d-19a4-45d9-9368-f08da485d5be  count=0

Fixes:

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

Resolves coder/internal#109

@mtojek mtojek self-assigned this Oct 16, 2024
@mtojek mtojek changed the title test: user barrier in TestInflightDispatchesMetric test: use barrier in TestInflightDispatchesMetric Oct 16, 2024
@mtojek mtojek requested a review from johnstcn October 16, 2024 11:55
@mtojek mtojek marked this pull request as ready for review October 16, 2024 11:55
@matifali
Copy link
Member

@mtojek is it same as coder/internal#109?

@mtojek
Copy link
Member Author

mtojek commented Oct 16, 2024

Yes.

@mtojek mtojek merged commit 416d67b into main Oct 16, 2024
39 checks passed
@mtojek mtojek deleted the fix-flaky-metrics branch October 16, 2024 12:12
@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 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: TestInflightDispatchesMetric
3 participants