With recent versions of Terraform and/or the test provider, running terraform test
with multiple test suites fails repeatedly.
Running terraform test
using GitHub Actions, I get error messages like this one:
│ Error: Failed to install required providers
│
│ Couldn't install necessary providers for test configuration tests/minimal:
│ some providers could not be installed:
│ - registry.terraform.io/ciscodevnet/aci: open
│ .terraform/testing-providers/registry.terraform.io/ciscodevnet/aci/2.7.0/linux_amd64/terraform-provider-aci_v2.7.0:
│ text file busy.
Running the tests locally I get error messages like this one:
│ Error: failed to read schema for module.main.aci_rest_managed.bgpRsPeerToProfile_export in registry.terraform.io/ciscodevnet/aci: failed to instantiate provider "registry.terraform.io/ciscodevnet/aci" to obtain schema: timeout while waiting for plugin to start
Debug logs:
2023-04-22T12:30:52.966+0200 [DEBUG] provider: starting plugin: path=tests/minimal/.terraform/providers/registry.terraform.io/ciscodevnet/aci/2.7.0/darwin_arm64/terraform-provider-aci_v2.7.0 args=[tests/minimal/.terraform/providers/registry.terraform.io/ciscodevnet/aci/2.7.0/darwin_arm64/terraform-provider-aci_v2.7.0]
2023-04-22T12:30:52.968+0200 [DEBUG] provider: plugin started: path=tests/minimal/.terraform/providers/registry.terraform.io/ciscodevnet/aci/2.7.0/darwin_arm64/terraform-provider-aci_v2.7.0 pid=90569
2023-04-22T12:30:52.968+0200 [DEBUG] provider: waiting for RPC address: path=tests/minimal/.terraform/providers/registry.terraform.io/ciscodevnet/aci/2.7.0/darwin_arm64/terraform-provider-aci_v2.7.0
2023-04-22T12:31:52.972+0200 [TRACE] Completed graph transform *terraform.AttachSchemaTransformer (no changes)
023-04-22T12:31:52.975+0200 [WARN] provider: plugin failed to exit gracefully
2023-04-22T12:31:52.979+0200 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
Running the tests individually works without an issue. Btw, this might be a useful feature, to select test suites using a regex like commonly implemented in other testing frameworks.