From 7b3441f1c1f6de1fa22a922bd4ae43f12e461641 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Mon, 17 Sep 2018 15:00:09 -0700 Subject: [PATCH] core: Fix TestContext2Apply_resourceDependsOnModuleDestroy We can't use diff attributes to differentiate instances during destroy because destroy diffs don't have any attributes set in the old API. Also, our new state management code correctly prunes out the empty module.child before returning, so our expected output is updated to not expect that to still be present. --- terraform/context_apply_test.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/terraform/context_apply_test.go b/terraform/context_apply_test.go index 8e33708dd7..7bbfabbb3f 100644 --- a/terraform/context_apply_test.go +++ b/terraform/context_apply_test.go @@ -408,7 +408,7 @@ func TestContext2Apply_resourceDependsOnModuleDestroy(t *testing.T) { is *InstanceState, id *InstanceDiff) (*InstanceState, error) { - if id.Attributes["ami"] != nil && id.Attributes["ami"].New == "parent" { + if is.Attributes["ami"] == "parent" { checked = true // Sleep to allow parallel execution @@ -448,11 +448,7 @@ func TestContext2Apply_resourceDependsOnModuleDestroy(t *testing.T) { t.Fatal("should check") } - checkStateString(t, state, ` - -module.child: - - `) + checkStateString(t, state, ``) } }