From 19dc881d94334f068ec0281ab7660d047225ee6f Mon Sep 17 00:00:00 2001 From: Seebs Date: Wed, 5 Oct 2022 17:21:50 -0500 Subject: [PATCH] test for correct state during test startup When we've started a fake cluster, we should expect to reach a "STARTING" state, not a "DOWN" state. This test would coincidentally pass as long as we checked the state before any of the nodes got their notification from the node watcher that at least one node was STARTING, because prior to that the cluster would be DOWN. But once it got to STARTING, we would wait forever; we never reached the instruction to tell the nodes to come to any other state, and they would never reach a DOWN state. --- etcd/leasedkv_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etcd/leasedkv_test.go b/etcd/leasedkv_test.go index 6ca7a208a..dd9b12e0a 100644 --- a/etcd/leasedkv_test.go +++ b/etcd/leasedkv_test.go @@ -29,7 +29,7 @@ func TestClusterKv(t *testing.T) { if err != nil { t.Fatalf("starting cluster: %v", err) } - c.MustAwaitClusterState(disco.ClusterStateDown, 10*time.Second) + c.MustAwaitClusterState(disco.ClusterStateStarting, 10*time.Second) err = c.BringUp() if err != nil { t.Fatalf("bringing up cluster: %v", err)