e2e: use -detach mode when registering jobs with cli

This PR changes the e2e helper thingy to set -detach option
when registering a job with the CLI instead of the API. This is
necessary for jobs which never become healthy, as the deployment
never finishes for failing jobs and the command never returns,
causing the test to timeout after 10 minutes.
This commit is contained in:
Seth Hoenig
2021-06-18 12:08:27 -05:00
parent 57fdb81433
commit 15d39f0dee

View File

@@ -12,7 +12,7 @@ import (
// Register registers a jobspec from a file but with a unique ID.
// The caller is responsible for recording that ID for later cleanup.
func Register(jobID, jobFilePath string) error {
cmd := exec.Command("nomad", "job", "run", "-")
cmd := exec.Command("nomad", "job", "run", "-detach", "-")
stdin, err := cmd.StdinPipe()
if err != nil {
return fmt.Errorf("could not open stdin?: %w", err)