linode / terraform-provider-linode

Terraform Linode provider
https://www.terraform.io/docs/providers/linode/
Mozilla Public License 2.0
202 stars 98 forks source link

Simplify test retry system; fix hang when certain retryable tests fail #1629

Closed lgarber-akamai closed 3 weeks ago

lgarber-akamai commented 1 month ago

📝 Description

This pull request simplifies the test failure retry system by removing all channel logic and making use of testing.TB (interface) across all helper functions. This ensures retry closures always access the *acceptance.WrappedT wrapper rather than directly accessing *testing.T, which resolves an issue where certain retryable tests (e.g. TestAccIPv6Range_raceCondition) would hang indefinitely on failure.

✔️ How to Test

The following test steps assume you have pulled down this PR locally.

Integration Testing

Running All Tests

make int-test

Verifying the Hanging Tests Fix

  1. Ensure the number of resources provisioned in the ipv6range_route_target test template (located in linode/ipv6range/tmpl/route_target.gotf) is greater than your account's IPv6 allocation limit.

  2. Run the TestAccIPv6Range_raceCondition test:

make PKG_NAME=linode/ipv6range ARGS="-run TestAccIPv6Range_raceCondition" int-test
  1. Ensure the test fails after 3 attempts without hanging.
  2. Alter the test template to provision fewer resources than your account's IPv6 allocation limit.
  3. Re-run the test and ensure it passes as expected.
lgarber-akamai commented 1 month ago

Integration suite run: https://github.com/linode/terraform-provider-linode/actions/runs/11464303341

lgarber-akamai commented 3 weeks ago

https://github.com/linode/terraform-provider-linode/actions/runs/11522269929