Skip to content

Commit 078ac7c

Browse files
authored
fix: TestTest_Parallel adds delay to ensure order (#37890)
Signed-off-by: Max Qian <[email protected]>
1 parent af0aaba commit 078ac7c

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

internal/command/test_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,9 +1256,6 @@ func TestTest_Parallel_Divided_Order(t *testing.T) {
12561256
}
12571257

12581258
func TestTest_Parallel(t *testing.T) {
1259-
// Skipped due to flakiness - see https://github.com/hashicorp/terraform/issues/37593
1260-
t.Skip()
1261-
12621259
td := t.TempDir()
12631260
testCopyDir(t, testFixturePath(path.Join("test", "parallel")), td)
12641261
t.Chdir(td)

internal/command/testdata/test/parallel/main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ variable "input" {
33
type = string
44
}
55

6+
variable "delay" {
7+
type = number
8+
default = 0
9+
}
10+
611
resource "test_resource" "foo" {
12+
create_wait_seconds = var.delay
713
value = var.input
814
}
915

internal/command/testdata/test/parallel/parallel.tftest.hcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ run "test_a" {
5252
run "test_b" {
5353
variables {
5454
input = run.test_a.value
55+
delay = 2 // Simulate a longer run to allow `test_d` to start in parallel
5556
}
5657

5758
assert {

0 commit comments

Comments
 (0)