Skip to content

Commit 6c4f9ca

Browse files
authored
test: test fail fix due to calling wrong TestOptions (#305)
1 parent 76b39f2 commit 6c4f9ca

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

examples/default/main.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@ module "vpes" {
7171
cloud_services = var.cloud_services
7272
cloud_service_by_crn = var.cloud_service_by_crn
7373
service_endpoints = var.service_endpoints
74+
# Wait 30secs after security group is destroyed before destroying VPE to workaround timing issue which can produce “Target not found” error on destroy
75+
depends_on = [time_sleep.wait_30_seconds]
7476
}
7577

78+
resource "time_sleep" "wait_30_seconds" {
79+
depends_on = [data.ibm_is_security_group.default_sg]
80+
81+
destroy_duration = "30s"
82+
}
83+
84+
7685
##############################################################################

examples/default/versions.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ terraform {
1010
source = "IBM-Cloud/ibm"
1111
version = "1.51.0"
1212
}
13+
time = {
14+
source = "hashicorp/time"
15+
version = "0.9.1"
16+
}
1317
}
1418
}
1519

tests/pr_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const resourceGroup = "geretain-test-resources"
1313
const defaultExampleTerraformDir = "examples/default"
1414

1515
func setupOptions(t *testing.T, prefix string, dir string) *testhelper.TestOptions {
16-
options := testhelper.TestOptionsDefault(&testhelper.TestOptions{
16+
options := testhelper.TestOptionsDefaultWithVars(&testhelper.TestOptions{
1717
Testing: t,
1818
TerraformDir: dir,
1919
Prefix: prefix,

0 commit comments

Comments
 (0)