From 5cb614ed7323303a5e55a2648410cbd9ec5099bd Mon Sep 17 00:00:00 2001 From: Derek Menteer Date: Mon, 6 Nov 2023 13:46:22 -0600 Subject: [PATCH] Fix flaky snapshot test. --- agent/snapshot_endpoint_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/agent/snapshot_endpoint_test.go b/agent/snapshot_endpoint_test.go index a534fe0251..31d731a26e 100644 --- a/agent/snapshot_endpoint_test.go +++ b/agent/snapshot_endpoint_test.go @@ -74,6 +74,7 @@ func TestSnapshot_Options(t *testing.T) { t.Run(method, func(t *testing.T) { a := NewTestAgent(t, TestACLConfig()) defer a.Shutdown() + testrpc.WaitForLeader(t, a.RPC, "dc1") body := bytes.NewBuffer(nil) req, _ := http.NewRequest(method, "/v1/snapshot", body) @@ -88,6 +89,7 @@ func TestSnapshot_Options(t *testing.T) { t.Run(method, func(t *testing.T) { a := NewTestAgent(t, TestACLConfig()) defer a.Shutdown() + testrpc.WaitForLeader(t, a.RPC, "dc1") body := bytes.NewBuffer(nil) req, _ := http.NewRequest(method, "/v1/snapshot?dc=nope", body) @@ -101,6 +103,7 @@ func TestSnapshot_Options(t *testing.T) { t.Run(method, func(t *testing.T) { a := NewTestAgent(t, TestACLConfig()) defer a.Shutdown() + testrpc.WaitForLeader(t, a.RPC, "dc1") body := bytes.NewBuffer(nil) req, _ := http.NewRequest(method, "/v1/snapshot?stale", body)