From f7d4bd2fd1494d25fb5710f43bb127e77565853b Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Thu, 3 Oct 2024 13:22:41 -0400 Subject: [PATCH] test: wait for keyring in plan submission tests (#24122) In #23977 we merged a change to how the keyring was stored. Because keyring initialization takes slightly longer now, this uncovered existing timing bugs in some of our tests where tests that require the keyring (ex. plan applier tests) were waiting for the leader but not the keyring initialization. Fix another example we've seen causing test flakes. --- nomad/worker_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nomad/worker_test.go b/nomad/worker_test.go index 777f694b147b..c63deec3da0d 100644 --- a/nomad/worker_test.go +++ b/nomad/worker_test.go @@ -449,7 +449,7 @@ func TestWorker_SubmitPlan(t *testing.T) { c.EnabledSchedulers = []string{structs.JobTypeService} }) defer cleanupS1() - testutil.WaitForLeader(t, s1.RPC) + testutil.WaitForKeyring(t, s1.RPC, s1.Region()) // Register node node := mock.Node()