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.
This commit is contained in:
Seebs 2022-10-05 17:21:50 -05:00 committed by seebs
parent 83e08efa0a
commit 19dc881d94

View file

@ -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)