Skip to content

Commit

Permalink
delay destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
max-lobur committed Oct 14, 2021
1 parent ec46e30 commit 237146d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions test/src/examples_complete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ func TestExamplesComplete(t *testing.T) {
// This will run `terraform init` and `terraform apply` and fail the test if there are any errors
terraform.InitAndApply(t, terraformOptions)

time.Sleep(30 * time.Second)

// Run `terraform output` to get the value of an output variable
userName := terraform.Output(t, terraformOptions, "user_name")

Expand Down Expand Up @@ -88,6 +90,8 @@ func TestExamplesCompleteWithGrants(t *testing.T) {
// This will run `terraform init` and `terraform apply` and fail the test if there are any errors
terraform.InitAndApply(t, terraformOptions)

time.Sleep(30 * time.Second)

// Run `terraform output` to get the value of an output variable
s3BucketId := terraform.Output(t, terraformOptions, "bucket_id")

Expand Down Expand Up @@ -125,6 +129,8 @@ func TestExamplesCompleteWithObjectLock(t *testing.T) {
// This will run `terraform init` and `terraform apply` and fail the test if there are any errors
terraform.InitAndApply(t, terraformOptions)

time.Sleep(30 * time.Second)

// Run `terraform output` to get the value of an output variable
s3BucketId := terraform.Output(t, terraformOptions, "bucket_id")
expectedS3BucketId := "eg-test-s3-object-lock-test-" + attributes[0]
Expand Down Expand Up @@ -160,6 +166,8 @@ func TestExamplesCompleteWithLifecycleRules(t *testing.T) {
// This will run `terraform init` and `terraform apply` and fail the test if there are any errors
terraform.InitAndApply(t, terraformOptions)

time.Sleep(30 * time.Second)

// Run `terraform output` to get the value of an output variable
s3BucketId := terraform.Output(t, terraformOptions, "bucket_id")

Expand Down Expand Up @@ -197,6 +205,8 @@ func TestExamplesCompleteWithReplication(t *testing.T) {
// This will run `terraform init` and `terraform apply` and fail the test if there are any errors
terraform.InitAndApply(t, terraformOptions)

time.Sleep(30 * time.Second)

// Run `terraform output` to get the value of an output variable
s3BucketId := terraform.Output(t, terraformOptions, "bucket_id")

Expand All @@ -216,7 +226,6 @@ func TestExamplesCompleteWithReplication(t *testing.T) {

// Verify we're getting back the outputs we expect
assert.NotEmptyf(t, s3ReplicationRoleArn, "If replication is enabled, we should get a Replication Role ARN.")

}

func TestExamplesCompleteWithPrivilegedPrincipals(t *testing.T) {
Expand Down Expand Up @@ -249,6 +258,8 @@ func TestExamplesCompleteWithPrivilegedPrincipals(t *testing.T) {
// This will run `terraform init` and `terraform apply` and fail the test if there are any errors
terraform.InitAndApply(t, terraformOptions)

time.Sleep(30 * time.Second)

// Run `terraform output` to get the value of an output variable
s3BucketId := terraform.Output(t, terraformOptions, "bucket_id")

Expand Down Expand Up @@ -356,6 +367,8 @@ func TestExamplesCompleteDisabled(t *testing.T) {
// This will run `terraform init` and `terraform apply` and fail the test if there are any errors
terraform.InitAndApply(t, terraformOptions)

time.Sleep(30 * time.Second)

// Run `terraform output` to get the value of an output variable
userName := terraform.Output(t, terraformOptions, "user_name")

Expand All @@ -373,5 +386,4 @@ func TestExamplesCompleteDisabled(t *testing.T) {

// Verify we're getting back the outputs we expect
assert.Empty(t, s3ReplicationBucketId, "When disabled, module should have no outputs.")

}

0 comments on commit 237146d

Please sign in to comment.