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.
This commit is contained in:
Martin Atkins 2018-09-17 15:00:09 -07:00
parent 56965c2be7
commit 7b3441f1c1

View File

@ -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, `
<no state>
module.child:
<no state>
`)
checkStateString(t, state, `<no state>`)
}
}