You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm implementing a switchover, where a primary becomes the replica, and the replica becomes the primary in one apply. This causes some issues in testing. After this operation is applied, a refresh or plan is needed to verify that plan is not empty. Currently, acceptance tests say that after applying this config, the plan is both empty and non-empty.
At this time, plan is "not empty", we just need a refresh and it will be an empty plan.
...
line 149: we do a refresh. Now, the plan is empty. (we should've done this before we do the plan check in line 133)
line 161: we do another plan after the refresh.
Now, here is why we see "schrodinger's plan"; plan is "both empty and non-empty"
line 188:
After applying this config step, a refresh is needed before we do checks.
I have:
{
Config: googleSqlDatabaseInstance_switchover(primaryName, replicaName),
ExpectNonEmptyPlan: true, // I commend and uncomment, and the error says that this step is both empty and non-empty.
},
Expected Behavior
When I commend and uncomment ExpectNonEmptyPlan: true, and the error should say that the step is either empty and non-empty, not BOTH.
Actual Behavior
The error says that the config test step results in an empty, and also non-empty plan.
SDK version
Latest
I'm implementing a switchover, where a primary becomes the replica, and the replica becomes the primary in one apply. This causes some issues in testing. After this operation is applied, a refresh or plan is needed to verify that plan is not empty. Currently, acceptance tests say that after applying this config, the plan is both empty and non-empty.
Here's a summary of https://github.com/hashicorp/terraform-plugin-sdk/blob/main/helper/resource/testing_new_config.go
Line 70: Apply config
Line 117: WorkingDir.CreatePlan()
Line 133:
At this time, plan is "not empty", we just need a refresh and it will be an empty plan.
...
line 149: we do a refresh. Now, the plan is empty. (we should've done this before we do the plan check in line 133)
line 161: we do another plan after the refresh.
Now, here is why we see "schrodinger's plan"; plan is "both empty and non-empty"
line 188:
The plan was non-empty before refresh in line 149, and is now empty.
Terraform Configuration Files
Initially:
In the next config step, we apply this config:
After applying this config step, a refresh is needed before we do checks.
I have:
{
Config: googleSqlDatabaseInstance_switchover(primaryName, replicaName),
ExpectNonEmptyPlan: true, // I commend and uncomment, and the error says that this step is both empty and non-empty.
},
Expected Behavior
When I commend and uncomment ExpectNonEmptyPlan: true, and the error should say that the step is either empty and non-empty, not BOTH.
Actual Behavior
The error says that the config test step results in an empty, and also non-empty plan.
Steps to Reproduce
Run this test with my pull request (switchover implementation)
GoogleCloudPlatform/magic-modules#11850
References
GoogleCloudPlatform/magic-modules#11850
The text was updated successfully, but these errors were encountered: