36ce1e73eb
The nodedrain deadline test asserts that all allocations are migrated by the deadline. However, when the deadline is short (e.g. 10s), the test may fail because of scheduler/client-propagation delays. In one failing test, it took ~15s from the RPC call to the moment to the moment the scheduler issued migration update, and then 3 seconds for the alloc to be stopped. Here, I increase the timeouts to avoid such false positives.
40 lines
585 B
HCL
40 lines
585 B
HCL
job "drain_deadline" {
|
|
datacenters = ["dc1", "dc2"]
|
|
|
|
constraint {
|
|
attribute = "${attr.kernel.name}"
|
|
value = "linux"
|
|
}
|
|
|
|
group "group" {
|
|
|
|
task "task" {
|
|
driver = "docker"
|
|
|
|
kill_timeout = "2m"
|
|
|
|
config {
|
|
image = "busybox:1"
|
|
command = "/bin/sh"
|
|
args = ["local/script.sh"]
|
|
}
|
|
|
|
template {
|
|
data = <<EOF
|
|
#!/bin/sh
|
|
trap 'sleep 60' 2
|
|
sleep 600
|
|
EOF
|
|
|
|
destination = "local/script.sh"
|
|
change_mode = "noop"
|
|
}
|
|
|
|
resources {
|
|
cpu = 256
|
|
memory = 128
|
|
}
|
|
}
|
|
}
|
|
}
|