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

kv/etcd: Fix race condition within unit test for Watch method #6479

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

CharlieTLe
Copy link
Member

Copied from grafana/dskit#336

Fixes a race condition during setup for Client.Watch tests where a conditional variable broadcast was missed by the caller waiting on the conditional variable.

Verified by running the tests many times with a timeout:

go test -timeout=10s -count=10000 -run=TestMockKV_Watch ./pkg/ring/kv/etcd/

Fixes:

Copied from grafana/dskit#336

Fixes a race condition during setup for Client.Watch tests where a
conditional variable broadcast was missed by the caller waiting on
the conditional variable.

Verified by running the tests many times with a timeout:

```
go test -timeout=10s -count=10000 -run=TestMockKV_Watch ./pkg/ring/kv/etcd/
```

Fixes:
- cortexproject#6478
- cortexproject#5564

Signed-off-by: Charlie Le <[email protected]>
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

Thanks!

@yeya24 yeya24 merged commit 42028f7 into cortexproject:master Jan 6, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants