e2e: constrain rescheduling test workloads to Linux (#8872)

The rescheduling test workloads were created before we had Windows targets in
the E2E nightly run. When these were recently ported to the e2e framework they
were missing the constraint to Linux machines.

Also added a little extra time to polling to avoid some flakiness on the first
run, and a minor readability adjustment to the job names.
This commit is contained in:
Tim Gross
2020-09-11 09:21:28 -04:00
committed by GitHub
parent c25ce6bc20
commit 04ee35b13f
13 changed files with 112 additions and 35 deletions

View File

@@ -97,7 +97,7 @@ func register(f *framework.F, jobFile, jobID string) {
func waitForAllocStatusComparison(query func() ([]string, error), comparison func([]string) bool) error {
var got []string
var err error
testutil.WaitForResultRetries(30, func() (bool, error) {
testutil.WaitForResultRetries(50, func() (bool, error) {
time.Sleep(time.Millisecond * 100)
got, err = query()
if err != nil {
@@ -113,7 +113,7 @@ func waitForAllocStatusComparison(query func() ([]string, error), comparison fun
func waitForLastDeploymentStatus(f *framework.F, jobID, status string) error {
var got string
var err error
testutil.WaitForResultRetries(30, func() (bool, error) {
testutil.WaitForResultRetries(50, func() (bool, error) {
time.Sleep(time.Millisecond * 100)
out, err := e2eutil.Command("nomad", "job", "status", jobID)

View File

@@ -1,6 +1,13 @@
job "test1" {
datacenters = ["dc1"]
type = "service"
datacenters = ["dc1", "dc2"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
type = "service"
group "t1" {
count = 3

View File

@@ -1,6 +1,13 @@
job "test5" {
datacenters = ["dc1"]
type = "service"
datacenters = ["dc1", "dc2"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
type = "service"
group "t5" {
count = 3

View File

@@ -1,6 +1,13 @@
job "test" {
datacenters = ["dc1"]
type = "service"
datacenters = ["dc1", "dc2"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
type = "service"
group "t1" {
count = 3

View File

@@ -1,6 +1,13 @@
job "test" {
datacenters = ["dc1"]
type = "service"
datacenters = ["dc1", "dc2"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
type = "service"
group "t" {
count = 3

View File

@@ -1,6 +1,13 @@
job "test2" {
datacenters = ["dc1"]
type = "service"
datacenters = ["dc1", "dc2"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
type = "service"
group "t2" {
count = 3

View File

@@ -1,6 +1,13 @@
job "demo2" {
datacenters = ["dc1"]
type = "service"
datacenters = ["dc1", "dc2"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
type = "service"
group "t2" {
count = 3

View File

@@ -1,6 +1,13 @@
job "demo3" {
datacenters = ["dc1"]
type = "service"
datacenters = ["dc1", "dc2"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
type = "service"
group "t2" {
count = 3

View File

@@ -1,6 +1,13 @@
job "demo2" {
datacenters = ["dc1"]
type = "service"
datacenters = ["dc1", "dc2"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
type = "service"
group "t2" {
count = 3

View File

@@ -1,6 +1,13 @@
job "test3" {
datacenters = ["dc1"]
type = "service"
datacenters = ["dc1", "dc2"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
type = "service"
group "t3" {
count = 3

View File

@@ -1,6 +1,13 @@
job "test" {
datacenters = ["dc1"]
type = "system"
datacenters = ["dc1", "dc2"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
type = "system"
group "t" {
count = 1

View File

@@ -1,6 +1,13 @@
job "test4" {
datacenters = ["dc1"]
type = "service"
datacenters = ["dc1", "dc2"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
type = "service"
group "t4" {
count = 3

View File

@@ -51,7 +51,7 @@ func (tc *RescheduleE2ETest) AfterEach(f *framework.F) {
// TestNoReschedule runs a job that should fail and never reschedule
func (tc *RescheduleE2ETest) TestNoReschedule(f *framework.F) {
jobID := "test-no-reschedule" + uuid.Generate()[0:8]
jobID := "test-no-reschedule-" + uuid.Generate()[0:8]
register(f, "rescheduling/input/norescheduling.nomad", jobID)
tc.jobIds = append(tc.jobIds, jobID)
@@ -65,7 +65,7 @@ func (tc *RescheduleE2ETest) TestNoReschedule(f *framework.F) {
// TestNoRescheduleSystem runs a system job that should fail and never reschedule
func (tc *RescheduleE2ETest) TestNoRescheduleSystem(f *framework.F) {
jobID := "test-reschedule-system" + uuid.Generate()[0:8]
jobID := "test-reschedule-system-" + uuid.Generate()[0:8]
register(f, "rescheduling/input/rescheduling_system.nomad", jobID)
tc.jobIds = append(tc.jobIds, jobID)
@@ -86,7 +86,7 @@ func (tc *RescheduleE2ETest) TestNoRescheduleSystem(f *framework.F) {
// TestDefaultReschedule runs a job that should reschedule after delay
func (tc *RescheduleE2ETest) TestDefaultReschedule(f *framework.F) {
jobID := "test-default-reschedule" + uuid.Generate()[0:8]
jobID := "test-default-reschedule-" + uuid.Generate()[0:8]
register(f, "rescheduling/input/rescheduling_default.nomad", jobID)
tc.jobIds = append(tc.jobIds, jobID)
@@ -111,7 +111,7 @@ func (tc *RescheduleE2ETest) TestDefaultReschedule(f *framework.F) {
// TestRescheduleMaxAttempts runs a job with a maximum reschedule attempts
func (tc *RescheduleE2ETest) TestRescheduleMaxAttempts(f *framework.F) {
jobID := "test-reschedule-fail" + uuid.Generate()[0:8]
jobID := "test-reschedule-fail-" + uuid.Generate()[0:8]
register(f, "rescheduling/input/rescheduling_fail.nomad", jobID)
tc.jobIds = append(tc.jobIds, jobID)
@@ -146,7 +146,7 @@ func (tc *RescheduleE2ETest) TestRescheduleMaxAttempts(f *framework.F) {
// TestRescheduleSuccess runs a job that should be running after rescheduling
func (tc *RescheduleE2ETest) TestRescheduleSuccess(f *framework.F) {
jobID := "test-reschedule-success" + uuid.Generate()[0:8]
jobID := "test-reschedule-success-" + uuid.Generate()[0:8]
register(f, "rescheduling/input/rescheduling_success.nomad", jobID)
tc.jobIds = append(tc.jobIds, jobID)
@@ -168,7 +168,7 @@ func (tc *RescheduleE2ETest) TestRescheduleSuccess(f *framework.F) {
// it gets rescheduled
func (tc *RescheduleE2ETest) TestRescheduleWithUpdate(f *framework.F) {
jobID := "test-reschedule-update" + uuid.Generate()[0:8]
jobID := "test-reschedule-update-" + uuid.Generate()[0:8]
register(f, "rescheduling/input/rescheduling_update.nomad", jobID)
tc.jobIds = append(tc.jobIds, jobID)
@@ -198,7 +198,7 @@ func (tc *RescheduleE2ETest) TestRescheduleWithUpdate(f *framework.F) {
// canary gets rescheduled
func (tc *RescheduleE2ETest) TestRescheduleWithCanary(f *framework.F) {
jobID := "test-reschedule-canary" + uuid.Generate()[0:8]
jobID := "test-reschedule-canary-" + uuid.Generate()[0:8]
register(f, "rescheduling/input/rescheduling_canary.nomad", jobID)
tc.jobIds = append(tc.jobIds, jobID)
@@ -234,7 +234,7 @@ func (tc *RescheduleE2ETest) TestRescheduleWithCanary(f *framework.F) {
// the job gets reverted
func (tc *RescheduleE2ETest) TestRescheduleWithCanaryAutoRevert(f *framework.F) {
jobID := "test-reschedule-canary-revert" + uuid.Generate()[0:8]
jobID := "test-reschedule-canary-revert-" + uuid.Generate()[0:8]
register(f, "rescheduling/input/rescheduling_canary_autorevert.nomad", jobID)
tc.jobIds = append(tc.jobIds, jobID)
@@ -277,7 +277,7 @@ func (tc *RescheduleE2ETest) TestRescheduleWithCanaryAutoRevert(f *framework.F)
// TestRescheduleMaxParallel updates a job with a max_parallel config
func (tc *RescheduleE2ETest) TestRescheduleMaxParallel(f *framework.F) {
jobID := "test-reschedule-maxp" + uuid.Generate()[0:8]
jobID := "test-reschedule-maxp-" + uuid.Generate()[0:8]
register(f, "rescheduling/input/rescheduling_maxp.nomad", jobID)
tc.jobIds = append(tc.jobIds, jobID)
@@ -317,7 +317,7 @@ func (tc *RescheduleE2ETest) TestRescheduleMaxParallel(f *framework.F) {
// config that will autorevert on failure
func (tc *RescheduleE2ETest) TestRescheduleMaxParallelAutoRevert(f *framework.F) {
jobID := "test-reschedule-maxp-revert" + uuid.Generate()[0:8]
jobID := "test-reschedule-maxp-revert-" + uuid.Generate()[0:8]
register(f, "rescheduling/input/rescheduling_maxp_autorevert.nomad", jobID)
tc.jobIds = append(tc.jobIds, jobID)
@@ -376,7 +376,7 @@ func (tc *RescheduleE2ETest) TestRescheduleMaxParallelAutoRevert(f *framework.F)
// progress deadline
func (tc *RescheduleE2ETest) TestRescheduleProgressDeadline(f *framework.F) {
jobID := "test-reschedule-deadline" + uuid.Generate()[0:8]
jobID := "test-reschedule-deadline-" + uuid.Generate()[0:8]
register(f, "rescheduling/input/rescheduling_progressdeadline.nomad", jobID)
tc.jobIds = append(tc.jobIds, jobID)