mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
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:
parent
56965c2be7
commit
7b3441f1c1
@ -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>`)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user