Merge pull request #14223 from hashicorp/b-update-nomad-tests

provider/nomad: Update Nomad provider tests
This commit is contained in:
Jake Champlin 2017-05-04 16:18:49 -04:00 committed by GitHub
commit d63ad7f949
1 changed files with 5 additions and 1 deletions

View File

@ -288,7 +288,11 @@ func testResourceJob_updateCheck(s *terraform.State) error {
// Verify foo doesn't exist
job, _, err := client.Jobs().Info("foo", nil)
if err != nil {
return fmt.Errorf("error reading %q job: %s", "foo", err)
// Job could have already been purged from nomad server
if !strings.Contains(err.Error(), "(job not found)") {
return fmt.Errorf("error reading %q job: %s", "foo", err)
}
return nil
}
if job.Status != "dead" {
return fmt.Errorf("%q job is not dead. Status: %q", "foo", job.Status)