From d4a03f21fb0b8f844ee646149ddcd4fd53623a76 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 b87789d06..d33b72ade 100644 --- a/etcd/leasedkv_test.go +++ b/etcd/leasedkv_test.go @@ -31,7 +31,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)