Skip to content

Commit df6158c

Browse files
authored
e2e: corrections to system deployment tests (#27054)
1 parent 3f42610 commit df6158c

File tree

5 files changed

+22
-50
lines changed

5 files changed

+22
-50
lines changed

e2e/scheduler_system/input/system_canary_v0.nomad.hcl

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,11 @@ job "system_job" {
3030
mode = "delay"
3131
}
3232

33-
task "system_task" {
34-
driver = "docker"
35-
33+
task "sleepy" {
34+
driver = "raw_exec"
3635
config {
37-
image = "busybox:1"
38-
39-
command = "/bin/sh"
40-
args = ["-c", "sleep 15000"]
41-
}
42-
43-
env {
44-
version = "0"
36+
command = "/bin/sleep"
37+
args = ["1000m"]
4538
}
4639
}
4740
}

e2e/scheduler_system/input/system_canary_v0_100.nomad.hcl

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,11 @@ job "system_job" {
2828
mode = "delay"
2929
}
3030

31-
task "system_task" {
32-
driver = "docker"
33-
31+
task "sleepy" {
32+
driver = "raw_exec"
3433
config {
35-
image = "busybox:1"
36-
37-
command = "/bin/sh"
38-
args = ["-c", "sleep 15000"]
39-
}
40-
41-
env {
42-
version = "0"
34+
command = "/bin/sleep"
35+
args = ["1000m"]
4336
}
4437
}
4538
}

e2e/scheduler_system/input/system_canary_v1.nomad.hcl

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,11 @@ job "system_job" {
3030
mode = "delay"
3131
}
3232

33-
task "system_task" {
34-
driver = "docker"
35-
33+
task "sleepy" {
34+
driver = "raw_exec"
3635
config {
37-
image = "busybox:1"
38-
39-
command = "/bin/sh"
40-
args = ["-c", "sleep 150000"]
41-
}
42-
43-
env {
44-
version = "1"
36+
command = "/bin/sleep"
37+
args = ["100m"]
4538
}
4639
}
4740
}

e2e/scheduler_system/input/system_canary_v1_100.nomad.hcl

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,11 @@ job "system_job" {
2828
mode = "delay"
2929
}
3030

31-
task "system_task" {
32-
driver = "docker"
33-
31+
task "sleepy" {
32+
driver = "raw_exec"
3433
config {
35-
image = "busybox:1"
36-
37-
command = "/bin/sh"
38-
args = ["-c", "sleep 150000"]
39-
}
40-
41-
env {
42-
version = "1"
34+
command = "/bin/sleep"
35+
args = ["100m"]
4336
}
4437
}
4538
}

e2e/scheduler_system/systemsched_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,6 @@ func testCanaryUpdate(t *testing.T) {
114114
)
115115
t.Cleanup(cleanup2)
116116

117-
// Get updated allocations
118-
allocs := job2.Allocs()
119-
must.SliceNotEmpty(t, allocs)
120-
121117
deploymentsApi := job2.DeploymentsApi()
122118
deploymentsList, _, err := deploymentsApi.List(nil)
123119
must.NoError(t, err)
@@ -131,7 +127,7 @@ func testCanaryUpdate(t *testing.T) {
131127
must.NotNil(t, deployment)
132128

133129
// wait for the canary allocations to become healthy
134-
timeout, cancel := context.WithTimeout(context.Background(), 30*time.Second)
130+
timeout, cancel := context.WithTimeout(context.Background(), 60*time.Second)
135131
defer cancel()
136132

137133
job2.WaitForDeploymentFunc(timeout, deployment.ID, func(d *api.Deployment) bool {
@@ -143,6 +139,10 @@ func testCanaryUpdate(t *testing.T) {
143139
return false
144140
})
145141

142+
// Get updated allocations
143+
allocs := job2.Allocs()
144+
must.SliceNotEmpty(t, allocs)
145+
146146
// find allocations from v1 version of the job, they should all be canaries
147147
// and there should be exactly 50% (rounded up) of v0 allocations
148148
count := 0
@@ -231,7 +231,7 @@ func testCanaryDeploymentToAllEligibleNodes(t *testing.T) {
231231
must.NotNil(t, deployment)
232232

233233
// wait for the canary allocations to become healthy
234-
timeout, cancel := context.WithTimeout(context.Background(), 30*time.Second)
234+
timeout, cancel := context.WithTimeout(context.Background(), 60*time.Second)
235235
defer cancel()
236236

237237
job2.WaitForDeploymentFunc(timeout, deployment.ID, func(d *api.Deployment) bool {

0 commit comments

Comments
 (0)