Merge pull request #1305 from snyk/test/google_bigquery_dataset

Add retry policy for google_bigquery_dataset acc test
main
Elie 2022-01-03 10:34:52 +01:00 committed by GitHub
commit 1e9a3fe273
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package google_test
import (
"testing"
"time"
"github.com/snyk/driftctl/test"
"github.com/snyk/driftctl/test/acceptance"
@ -17,6 +18,11 @@ func TestAcc_Google_BigqueryDataset(t *testing.T) {
},
Checks: []acceptance.AccCheck{
{
// New resources are not visible immediately on GCP api after an apply operation
// Logic below retry driftctl scan until we can retrieve the results (infra will be in sync) and for maximum 60 seconds
ShouldRetry: func(result *test.ScanResult, retryDuration time.Duration, retryCount uint8) bool {
return !result.IsSync() && retryDuration < time.Minute
},
Check: func(result *test.ScanResult, stdout string, err error) {
if err != nil {
t.Fatal(err)