From d38e0ebb92e8d70a5ece53f8569175d2925b50f4 Mon Sep 17 00:00:00 2001 From: Thomas Jungblut Date: Fri, 29 Jul 2022 15:56:37 +0200 Subject: [PATCH] Checking cluster member count in watch_test The test should fail early on an insufficient cluster instead of panicking during the test. Fixes issue #14259. Signed-off-by: Thomas Jungblut --- clientv3/integration/watch_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clientv3/integration/watch_test.go b/clientv3/integration/watch_test.go index f553385a999..2166c5d6cec 100644 --- a/clientv3/integration/watch_test.go +++ b/clientv3/integration/watch_test.go @@ -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 { + 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