diff --git a/e2e/e2eutil/utils.go b/e2e/e2eutil/utils.go index 7c2212212..1348a5646 100644 --- a/e2e/e2eutil/utils.go +++ b/e2e/e2eutil/utils.go @@ -78,12 +78,13 @@ func RegisterAllocs(t *testing.T, nomadClient *api.Client, jobFile string, jobID } func RegisterAndWaitForAllocs(t *testing.T, nomadClient *api.Client, jobFile string, jobID string) []*api.AllocationListStub { - // Parse job require := require.New(t) - allocs := RegisterAllocs(t, nomadClient, jobFile, jobID) g := NewGomegaWithT(t) jobs := nomadClient.Jobs() + // Start allocations + RegisterAllocs(t, nomadClient, jobFile, jobID) + // Wrap in retry to wait until placement g.Eventually(func() []*api.AllocationListStub { // Look for allocations