diff --git a/helper/resource/testing.go b/helper/resource/testing.go index 90cfc175fa..43a59e93c0 100644 --- a/helper/resource/testing.go +++ b/helper/resource/testing.go @@ -230,6 +230,16 @@ func testStep( } } + // Verify that Plan is now empty and we don't have a perpetual diff issue + if p, err := ctx.Plan(); err != nil { + return state, fmt.Errorf("Error on follow-up plan: %s", err) + } else { + if p.Diff != nil && !p.Diff.Empty() { + return state, fmt.Errorf( + "After applying this step, the plan was not empty:\n\n%s", p) + } + } + return state, err } diff --git a/helper/resource/testing_test.go b/helper/resource/testing_test.go index cf51c7b223..2f7ed0517f 100644 --- a/helper/resource/testing_test.go +++ b/helper/resource/testing_test.go @@ -18,6 +18,8 @@ func init() { func TestTest(t *testing.T) { mp := testProvider() + mp.DiffReturn = nil + mp.ApplyReturn = &terraform.InstanceState{ ID: "foo", }