From da592ab1b7afb02feef77d1ff184f60a6785682d Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Fri, 2 May 2025 14:30:10 -0400 Subject: [PATCH] testing: fix vault setup test's reliance on specific Raft index (#25806) The test for `nomad setup vault` command expects a specific `CreateIndex` for the job it creates. Any Raft write when a server comes up or establishes leadership can cause this test to break. Interpolate the expected index as we've done for other indexes on the job to make this test less brittle. Ref: https://github.com/hashicorp/nomad-enterprise/pull/2673#issuecomment-2847619747 --- command/setup_vault_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/command/setup_vault_test.go b/command/setup_vault_test.go index db30f566c..ceb02b452 100644 --- a/command/setup_vault_test.go +++ b/command/setup_vault_test.go @@ -87,7 +87,7 @@ test default batch pending expectedOut: fmt.Sprintf(`{ "JobsWithoutVaultIdentity": [ { - "CreateIndex": 10, + "CreateIndex": %d, "Datacenters": [ "dc1" ], @@ -111,7 +111,7 @@ test default batch pending "OutdatedNodes": [], "VaultTokens": null } -`, *job.CreateIndex, *job.ModifyIndex, *job.SubmitTime), +`, *job.CreateIndex, *job.CreateIndex, *job.ModifyIndex, *job.SubmitTime), }, { name: "-check with -t",