github.com/hernad/nomad@v1.6.112/e2e/clientstate/restarter.nomad (about) 1 # Copyright (c) HashiCorp, Inc. 2 # SPDX-License-Identifier: MPL-2.0 3 4 # Restarter fakes being a flaky service that crashes and restarts constantly. 5 # Restarting the Nomad agent during task restarts was a known cause of state 6 # corruption in v0.8. 7 8 job "restarter" { 9 datacenters = ["dc1"] 10 11 constraint { 12 attribute = "${attr.kernel.name}" 13 value = "linux" 14 } 15 16 group "restarter" { 17 restart { 18 attempts = 100 19 delay = "3s" 20 } 21 22 task "restarter" { 23 driver = "raw_exec" 24 25 config { 26 command = "/bin/bash" 27 args = ["-c", "echo $$ >> pid && sleep 1 && exit 99"] 28 } 29 } 30 } 31 }