From fc72a20c661df661007d5a715a76ef1f7cdfcf17 Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Tue, 4 Apr 2017 15:41:54 +0100 Subject: [PATCH] command/hook_ui: Increase max length of state IDs (#13317) --- command/hook_ui.go | 2 +- command/hook_ui_test.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/command/hook_ui.go b/command/hook_ui.go index 1cc1a9bbe1f3..8d8f4539e220 100644 --- a/command/hook_ui.go +++ b/command/hook_ui.go @@ -16,7 +16,7 @@ import ( ) const defaultPeriodicUiTimer = 10 * time.Second -const maxIdLen = 20 +const maxIdLen = 80 type UiHook struct { terraform.NilHook diff --git a/command/hook_ui_test.go b/command/hook_ui_test.go index cf618969f06c..2ffa40abf7a2 100644 --- a/command/hook_ui_test.go +++ b/command/hook_ui_test.go @@ -70,10 +70,10 @@ func TestUiHookPreApply_periodicTimer(t *testing.T) { close(uiState.DoneCh) <-uiState.done - expectedOutput := `data.aws_availability_zones.available: Destroying... (ID: 2017-03-0...0000 UTC) -data.aws_availability_zones.available: Still destroying... (ID: 2017-03-0...0000 UTC, 1s elapsed) -data.aws_availability_zones.available: Still destroying... (ID: 2017-03-0...0000 UTC, 2s elapsed) -data.aws_availability_zones.available: Still destroying... (ID: 2017-03-0...0000 UTC, 3s elapsed) + expectedOutput := `data.aws_availability_zones.available: Destroying... (ID: 2017-03-05 10:56:59.298784526 +0000 UTC) +data.aws_availability_zones.available: Still destroying... (ID: 2017-03-05 10:56:59.298784526 +0000 UTC, 1s elapsed) +data.aws_availability_zones.available: Still destroying... (ID: 2017-03-05 10:56:59.298784526 +0000 UTC, 2s elapsed) +data.aws_availability_zones.available: Still destroying... (ID: 2017-03-05 10:56:59.298784526 +0000 UTC, 3s elapsed) ` output := ui.OutputWriter.String() if output != expectedOutput { @@ -138,7 +138,7 @@ func TestUiHookPreApply_destroy(t *testing.T) { t.Fatalf("Expected hook to continue, given: %#v", action) } - expectedOutput := "data.aws_availability_zones.available: Destroying... (ID: 2017-03-0...0000 UTC)\n" + expectedOutput := "data.aws_availability_zones.available: Destroying... (ID: 2017-03-05 10:56:59.298784526 +0000 UTC)\n" output := ui.OutputWriter.String() if output != expectedOutput { t.Fatalf("Output didn't match.\nExpected: %q\nGiven: %q", expectedOutput, output)