Provider flakey tests

Hi,

One of my terraform providers works with an API which is unfortunately has a new version which has some performance issues and makes some of the functional test flakey.

I don’t see anything in the plugin test library to enable retrying of tests in given circumstances (and I hate the idea of handling flakey tests this way).

I could make all of the tests run sequentially, but this would add significant time to the test runs.

Is there any other solution you are aware of that might help in this situation?

Hey again @iwarapter :wave: Providers that need to deal with eventual consistency and written in terraform-plugin-sdk typically take advantage of the helper/resource.StateChangeConf (or simpler helper/resource.RetryContext()) functionality in the provider logic to ensure the API is stabilized. For terraform-plugin-framework based providers, either those helpers or any Go retrying library can be used.

Implementing stabilization in the provider logic, rather than working around the issue in testing logic, ensures that any real-world issues with the resource stability is handled in production usage as well. This model has worked really well at scale for eventually consistent APIs, such as AWS IAM. If you peek in the terraform-provider-aws codebase you can see this logic in a lot of places with those resources.