From 14b38b93e72e5f98d9c2b840792f7db7fc1b2e69 Mon Sep 17 00:00:00 2001 From: Florian Stadler Date: Mon, 13 Jan 2025 14:58:47 +0100 Subject: [PATCH] Fix TestAutonaming flakiness --- provider/pkg/provider/provider_2e2_test.go | 4 +++- provider/pkg/provider/testdata/autonaming/Pulumi.yaml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/provider/pkg/provider/provider_2e2_test.go b/provider/pkg/provider/provider_2e2_test.go index 55bfd99b95..43d027f96e 100644 --- a/provider/pkg/provider/provider_2e2_test.go +++ b/provider/pkg/provider/provider_2e2_test.go @@ -41,7 +41,9 @@ func TestAutonaming(t *testing.T) { assert.Contains(t, logGroupName, "autonaming-log-") // project + name + random suffix fifoQueueName, ok := up.Outputs["fifoQueueName"].Value.(string) assert.True(t, ok) - assert.Contains(t, fifoQueueName, "queue.fifo") // verbatim name + resource's autonaming trivia suffix + + // Check that the queue name matches pattern: ${name}-${alphanum(6)}.fifo (.fifo is the resource's autonaming trivia suffix) + assert.Regexp(t, `^queue-[a-zA-Z0-9]{6}\.fifo$`, fifoQueueName) } func testUpgradeFrom(t *testing.T, test *pulumitest.PulumiTest, version string) { diff --git a/provider/pkg/provider/testdata/autonaming/Pulumi.yaml b/provider/pkg/provider/testdata/autonaming/Pulumi.yaml index 69926f4016..fbfa49e431 100644 --- a/provider/pkg/provider/testdata/autonaming/Pulumi.yaml +++ b/provider/pkg/provider/testdata/autonaming/Pulumi.yaml @@ -9,7 +9,7 @@ config: pattern: ${project}-${name}-${alphanum(6)} resources: aws-native:sqs:Queue: - pattern: ${name} + pattern: ${name}-${alphanum(6)} resources: log: type: aws-native:logs:LogGroup