Skip to content

Commit 7b5e045

Browse files
authored
Merge pull request #1551 from snyk/fix/google_acc_tests
Add backoff retry to gcp acc tests
2 parents cde2d4c + 95d3650 commit 7b5e045

6 files changed

+18
-0
lines changed

pkg/resource/google/google_cloudrun_service_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package google_test
22

33
import (
44
"testing"
5+
"time"
56

67
"github.com/snyk/driftctl/test"
78
"github.com/snyk/driftctl/test/acceptance"
@@ -17,6 +18,8 @@ func TestAcc_Google_CloudRunService(t *testing.T) {
1718
},
1819
Checks: []acceptance.AccCheck{
1920
{
21+
// New resources are not visible immediately through GCP API after an apply operation.
22+
ShouldRetry: acceptance.LinearBackoff(10 * time.Minute),
2023
Check: func(result *test.ScanResult, stdout string, err error) {
2124
if err != nil {
2225
t.Fatal(err)

pkg/resource/google/google_compute_address_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package google_test
22

33
import (
44
"testing"
5+
"time"
56

67
"github.com/snyk/driftctl/test"
78
"github.com/snyk/driftctl/test/acceptance"
@@ -17,6 +18,8 @@ func TestAcc_Google_ComputeAddress(t *testing.T) {
1718
},
1819
Checks: []acceptance.AccCheck{
1920
{
21+
// New resources are not visible immediately through GCP API after an apply operation.
22+
ShouldRetry: acceptance.LinearBackoff(10 * time.Minute),
2023
Check: func(result *test.ScanResult, stdout string, err error) {
2124
if err != nil {
2225
t.Fatal(err)

pkg/resource/google/google_compute_disk_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package google_test
22

33
import (
44
"testing"
5+
"time"
56

67
"github.com/snyk/driftctl/test"
78
"github.com/snyk/driftctl/test/acceptance"
@@ -17,6 +18,8 @@ func TestAcc_Google_ComputeDisk(t *testing.T) {
1718
},
1819
Checks: []acceptance.AccCheck{
1920
{
21+
// New resources are not visible immediately through GCP API after an apply operation.
22+
ShouldRetry: acceptance.LinearBackoff(10 * time.Minute),
2023
Check: func(result *test.ScanResult, stdout string, err error) {
2124
if err != nil {
2225
t.Fatal(err)

pkg/resource/google/google_compute_forwarding_rule_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package google_test
22

33
import (
44
"testing"
5+
"time"
56

67
"github.com/snyk/driftctl/test"
78
"github.com/snyk/driftctl/test/acceptance"
@@ -17,6 +18,8 @@ func TestAcc_Google_ComputeForwardingRule(t *testing.T) {
1718
},
1819
Checks: []acceptance.AccCheck{
1920
{
21+
// New resources are not visible immediately through GCP API after an apply operation.
22+
ShouldRetry: acceptance.LinearBackoff(10 * time.Minute),
2023
Check: func(result *test.ScanResult, stdout string, err error) {
2124
if err != nil {
2225
t.Fatal(err)

pkg/resource/google/google_compute_health_check_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package google_test
22

33
import (
44
"testing"
5+
"time"
56

67
"github.com/snyk/driftctl/test"
78
"github.com/snyk/driftctl/test/acceptance"
@@ -17,6 +18,8 @@ func TestAcc_Google_ComputeHealthCheck(t *testing.T) {
1718
},
1819
Checks: []acceptance.AccCheck{
1920
{
21+
// New resources are not visible immediately through GCP API after an apply operation.
22+
ShouldRetry: acceptance.LinearBackoff(10 * time.Minute),
2023
Check: func(result *test.ScanResult, stdout string, err error) {
2124
if err != nil {
2225
t.Fatal(err)

pkg/resource/google/google_storage_bucket_iam_binding_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package google_test
22

33
import (
44
"testing"
5+
"time"
56

67
"github.com/snyk/driftctl/test"
78
"github.com/snyk/driftctl/test/acceptance"
@@ -17,6 +18,8 @@ func TestAcc_Google_StorageBucketIAMBinding(t *testing.T) {
1718
},
1819
Checks: []acceptance.AccCheck{
1920
{
21+
// New resources are not visible immediately through GCP API after an apply operation.
22+
ShouldRetry: acceptance.LinearBackoff(10 * time.Minute),
2023
Check: func(result *test.ScanResult, stdout string, err error) {
2124
if err != nil {
2225
t.Fatal(err)

0 commit comments

Comments
 (0)