fix a flapping test involving CreateBeforeDestroy

A typo in the config caused it to disagree with the plan on whether a
resource should be CreateBeforeDestroy, preventing it from being ordered
properly. Add the new CreateBeforeDestroy field to the test fixture
state as well for completeness.
This commit is contained in:
James Bardin 2020-03-10 16:12:12 -04:00
parent c7cc0afb80
commit cb99dddb4d
2 changed files with 3 additions and 5 deletions

View File

@ -10230,8 +10230,9 @@ func TestContext2Apply_moduleReplaceCycle(t *testing.T) {
Name: "a",
}.Instance(addrs.NoKey),
&states.ResourceInstanceObjectSrc{
Status: states.ObjectReady,
AttrsJSON: []byte(`{"id":"a","require_new":"old"}`),
Status: states.ObjectReady,
AttrsJSON: []byte(`{"id":"a","require_new":"old"}`),
CreateBeforeDestroy: mode == "cbd",
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("aws"),

View File

@ -1,8 +1,5 @@
resource "aws_instance" "a" {
require_new = "new"
lifecycle {
create_before_destroy = true
}
}
output "ids" {