Skip to content

Commit f11ffee

Browse files
fix TestAccAccessApprovalSettings (#12026) (#20759)
[upstream:f1195ac4693f23c334ed57348a2bcad51562a88b] Signed-off-by: Modular Magician <magic-modules@google.com>
1 parent 7c5452a commit f11ffee

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

.changelog/12026.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:none
2+
3+
```

google/services/accessapproval/resource_folder_access_approval_settings.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,11 @@ func resourceAccessApprovalFolderSettingsCreate(d *schema.ResourceData, meta int
266266
}
267267
d.SetId(id)
268268

269+
// This is useful if the resource in question doesn't have a perfectly consistent API
270+
// That is, the Operation for Create might return before the Get operation shows the
271+
// completed state of the resource.
272+
time.Sleep(4 * time.Minute)
273+
269274
log.Printf("[DEBUG] Finished creating FolderSettings %q: %#v", d.Id(), res)
270275

271276
return resourceAccessApprovalFolderSettingsRead(d, meta)
@@ -410,6 +415,10 @@ func resourceAccessApprovalFolderSettingsUpdate(d *schema.ResourceData, meta int
410415

411416
}
412417

418+
// This is useful if the resource in question doesn't have a perfectly consistent API
419+
// That is, the Operation for Create might return before the Get operation shows the
420+
// completed state of the resource.
421+
time.Sleep(4 * time.Minute)
413422
return resourceAccessApprovalFolderSettingsRead(d, meta)
414423
}
415424

google/services/accessapproval/resource_organization_access_approval_settings.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,11 @@ func resourceAccessApprovalOrganizationSettingsCreate(d *schema.ResourceData, me
226226
}
227227
d.SetId(id)
228228

229+
// This is useful if the resource in question doesn't have a perfectly consistent API
230+
// That is, the Operation for Create might return before the Get operation shows the
231+
// completed state of the resource.
232+
time.Sleep(4 * time.Minute)
233+
229234
log.Printf("[DEBUG] Finished creating OrganizationSettings %q: %#v", d.Id(), res)
230235

231236
return resourceAccessApprovalOrganizationSettingsRead(d, meta)
@@ -370,6 +375,10 @@ func resourceAccessApprovalOrganizationSettingsUpdate(d *schema.ResourceData, me
370375

371376
}
372377

378+
// This is useful if the resource in question doesn't have a perfectly consistent API
379+
// That is, the Operation for Create might return before the Get operation shows the
380+
// completed state of the resource.
381+
time.Sleep(4 * time.Minute)
373382
return resourceAccessApprovalOrganizationSettingsRead(d, meta)
374383
}
375384

google/services/accessapproval/resource_project_access_approval_settings.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,11 @@ func resourceAccessApprovalProjectSettingsCreate(d *schema.ResourceData, meta in
244244
}
245245
d.SetId(id)
246246

247+
// This is useful if the resource in question doesn't have a perfectly consistent API
248+
// That is, the Operation for Create might return before the Get operation shows the
249+
// completed state of the resource.
250+
time.Sleep(4 * time.Minute)
251+
247252
log.Printf("[DEBUG] Finished creating ProjectSettings %q: %#v", d.Id(), res)
248253

249254
return resourceAccessApprovalProjectSettingsRead(d, meta)
@@ -401,6 +406,10 @@ func resourceAccessApprovalProjectSettingsUpdate(d *schema.ResourceData, meta in
401406

402407
}
403408

409+
// This is useful if the resource in question doesn't have a perfectly consistent API
410+
// That is, the Operation for Create might return before the Get operation shows the
411+
// completed state of the resource.
412+
time.Sleep(4 * time.Minute)
404413
return resourceAccessApprovalProjectSettingsRead(d, meta)
405414
}
406415

0 commit comments

Comments
 (0)