From df8b9ced103f65ffd44d62afe6288fd8f9128886 Mon Sep 17 00:00:00 2001 From: Preetha Appan Date: Mon, 17 Dec 2018 14:39:14 -0600 Subject: [PATCH] Fix spread e2e test --- e2e/e2e_test.go | 1 + e2e/spread/spread.go | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index 5686cab01..2101ff0a1 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -5,6 +5,7 @@ import ( _ "github.com/hashicorp/nomad/e2e/affinities" _ "github.com/hashicorp/nomad/e2e/example" + _ "github.com/hashicorp/nomad/e2e/spread" ) func TestE2E(t *testing.T) { diff --git a/e2e/spread/spread.go b/e2e/spread/spread.go index 9da4da412..5793a43f3 100644 --- a/e2e/spread/spread.go +++ b/e2e/spread/spread.go @@ -36,8 +36,9 @@ func (tc *BasicSpreadStruct) TestEvenSpread(f *framework.F) { job, err := jobspec.ParseFile("spread/input/spread1.nomad") require := require.New(f.T()) require.Nil(err) - jobId := uuid.Generate() - job.ID = helper.StringToPtr("spr" + jobId[0:8]) + uuid := uuid.Generate() + jobId := "spr" + uuid[0:8] + job.ID = helper.StringToPtr(jobId) tc.jobIds = append(tc.jobIds, jobId) @@ -89,8 +90,9 @@ func (tc *BasicSpreadStruct) TestMultipleSpreads(f *framework.F) { job, err := jobspec.ParseFile("spread/input/spread2.nomad") require := require.New(f.T()) require.Nil(err) - jobId := uuid.Generate() - job.ID = helper.StringToPtr("spr" + jobId[0:8]) + uuid := uuid.Generate() + jobId := "spr" + uuid[0:8] + job.ID = helper.StringToPtr(jobId) tc.jobIds = append(tc.jobIds, jobId) @@ -142,13 +144,10 @@ func (tc *BasicSpreadStruct) TestMultipleSpreads(f *framework.F) { expectedDcToAllocs["dc2"] = 5 require.Equal(expectedDcToAllocs, dcToAllocs) - /* - TODO(preetha): known failure that needs investigation - expectedRackToAllocs := make(map[string]int) - expectedRackToAllocs["r1"] = 5 - expectedRackToAllocs["r2"] = 5 - require.Equal(expectedRackToAllocs, rackToAllocs) - */ + expectedRackToAllocs := make(map[string]int) + expectedRackToAllocs["r1"] = 7 + expectedRackToAllocs["r2"] = 3 + require.Equal(expectedRackToAllocs, rackToAllocs) }