diff --git a/command/apply_test.go b/command/apply_test.go index 280568b4f..407d00305 100644 --- a/command/apply_test.go +++ b/command/apply_test.go @@ -924,7 +924,7 @@ func TestApply_shutdown(t *testing.T) { "-auto-approve", testFixturePath("apply-shutdown"), } - if code := c.Run(args); code != 0 { + if code := c.Run(args); code != 1 { t.Fatalf("bad: %d\n\n%s", code, ui.ErrorWriter.String()) } diff --git a/command/plan_test.go b/command/plan_test.go index 7a99446a5..99525e32d 100644 --- a/command/plan_test.go +++ b/command/plan_test.go @@ -845,12 +845,8 @@ func TestPlan_shutdown(t *testing.T) { "-state=nonexistent.tfstate", testFixturePath("apply-shutdown"), }) - if code != 0 { - // FIXME: In retrospect cancellation ought to be an unsuccessful exit - // case, but we need to do that cautiously in case it impacts automation - // wrappers. See the note about this in the terraform.stopHook - // implementation for more. - t.Errorf("wrong exit code %d; want 0\noutput:\n%s", code, ui.OutputWriter.String()) + if code != 1 { + t.Errorf("wrong exit code %d; want 1\noutput:\n%s", code, ui.OutputWriter.String()) } select {