mirror of
https://github.com/kemko/nomad.git
synced 2026-01-03 17:05:43 +03:00
The E2E test suite for rescheduling had a few bugs: * Using the command line to stop a job with a failing deployment returns a non-zero exit code, which would cause an otherwise passing test to fail. * Two of the input jobs were actually invalid but were only correctly detected as such because of #17342 This changeset also updates the whole test suite to move it off the v1 "framework". A few test assertions are also de-flaked. Fixes: #19076
51 lines
940 B
HCL
51 lines
940 B
HCL
# Copyright (c) HashiCorp, Inc.
|
|
# SPDX-License-Identifier: BUSL-1.1
|
|
|
|
job "demo2" {
|
|
|
|
datacenters = ["dc1", "dc2"]
|
|
|
|
constraint {
|
|
attribute = "${attr.kernel.name}"
|
|
value = "linux"
|
|
}
|
|
|
|
type = "service"
|
|
|
|
group "t2" {
|
|
count = 1
|
|
|
|
task "t2" {
|
|
driver = "raw_exec"
|
|
|
|
config {
|
|
command = "bash"
|
|
args = ["-c", "exit 1"]
|
|
}
|
|
}
|
|
|
|
update {
|
|
# we want the first allocation to take a while before we give up on it,
|
|
# so that we can check the deployment's progress deadline before and
|
|
# after we determine it will never become healthy
|
|
min_healthy_time = "10s"
|
|
healthy_deadline = "15s"
|
|
progress_deadline = "20s"
|
|
|
|
max_parallel = 1
|
|
auto_revert = false
|
|
}
|
|
|
|
restart {
|
|
attempts = 0
|
|
mode = "fail"
|
|
}
|
|
|
|
reschedule {
|
|
unlimited = true
|
|
delay_function = "constant"
|
|
delay = "5s"
|
|
}
|
|
}
|
|
}
|