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

Checking cluster member count in watch_test #14285

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions clientv3/integration/watch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ func runWatchTest(t *testing.T, f watcherTest) {
clus := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 3})
defer clus.Terminate(t)

if len(clus.Members) != 3 {
Copy link

Choose a reason for hiding this comment

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

I've tried stepping through this test and there is check here
that waits for all members to be up. I think it checks for size implicitly.

Do we really need this extra check?

Copy link
Member

@ahrtr ahrtr Jul 31, 2022

Choose a reason for hiding this comment

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

Right, I don't think we should add the additional check either, unless you can provide a reasonable case in which the len(clus.Members) != 3 is true

t.Fatalf("not enough members in cluster, expected 3 but found %d", len(clus.Members))
}

wclientMember := rand.Intn(3)
w := clus.Client(wclientMember).Watcher
// select a different client for KV operations so puts succeed if
Expand Down