Skip to content

Commit 628aa24

Browse files
authored
test: Adds delay to avoid flakiness in TestAccProjectAPIKey_recreateWhenDeletedExternally (#3798)
* test: Add delay to avoid flakiness in TestAccProjectAPIKey_recreateWhenDeletedExternally * test: Improve comment for sleep duration in TestAccProjectAPIKey_recreateWhenDeletedExternally
1 parent 8ea03a9 commit 628aa24

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/service/projectapikey/resource_project_api_key_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"strconv"
99
"strings"
1010
"testing"
11+
"time"
1112

1213
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
1314
"github.com/hashicorp/terraform-plugin-testing/terraform"
@@ -174,6 +175,7 @@ func TestAccProjectAPIKey_recreateWhenDeletedExternally(t *testing.T) {
174175
if err := deleteAPIKeyManually(orgID, descriptionPrefix); err != nil {
175176
t.Fatalf("failed to manually delete API key resource: %s", err)
176177
}
178+
time.Sleep(5 * time.Second) // Avoid flaky empty plan error by ensuring the deletion is registered.
177179
},
178180
Config: config,
179181
PlanOnly: true,

0 commit comments

Comments
 (0)