open-nomad/e2e/clientstate/restarter.nomad

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
637 B
Plaintext
Raw Normal View History

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
# Restarter fakes being a flaky service that crashes and restarts constantly.
# Restarting the Nomad agent during task restarts was a known cause of state
# corruption in v0.8.
job "restarter" {
datacenters = ["dc1"]
2019-10-11 12:00:05 +00:00
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "restarter" {
restart {
attempts = 100
delay = "3s"
}
2019-10-11 12:00:05 +00:00
task "restarter" {
driver = "raw_exec"
2019-10-11 12:00:05 +00:00
config {
command = "/bin/bash"
args = ["-c", "echo $$ >> pid && sleep 1 && exit 99"]
}
}
}
}