From 2ce1d7d99029683aadd30cfa56f4bb94150c81bf Mon Sep 17 00:00:00 2001 From: Douglas Harcourt Parsons Date: Mon, 16 Dec 2024 10:33:59 +0000 Subject: [PATCH] Fix flaky access group test --- vercel/resource_access_group_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vercel/resource_access_group_test.go b/vercel/resource_access_group_test.go index a051a506..7a6ede42 100644 --- a/vercel/resource_access_group_test.go +++ b/vercel/resource_access_group_test.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "testing" + "time" "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" @@ -94,6 +95,10 @@ func testCheckAccessGroupDoesNotExist(n string) resource.TestCheckFunc { return fmt.Errorf("no ID is set") } + // The access group is deleted asynchronously, so it's eventually consistent. Work around this by sleepin a + // small amount of time. + time.Sleep(time.Second * 2) + _, err := testClient().GetAccessGroup(context.TODO(), client.GetAccessGroupRequest{ TeamID: testTeam(), AccessGroupID: rs.Primary.ID,