Skip to content

Commit

Permalink
Fix TestAutonaming flakiness (#1984)
Browse files Browse the repository at this point in the history
`TestAutonaming` occasionally fails if test runs are running within 1
minute of each other because SQS does not allow recreating a deleted
queue within 60s:
```
          aws-native:sqs:Queue (queue):
            error: creating resource: creating resource (await): operation CREATE failed with "Throttling": You must wait 60 seconds after deleting a queue before you can create another with the same name. (Service: Sqs, Status Code: 400, Request ID: 7503e9ea-2fa2-5fba-b1cc-b6117f9af4d4)
```

To fix this I added some random parts to the resource name

Fixes #1983
  • Loading branch information
flostadler authored Jan 13, 2025
1 parent d2f41e5 commit 4104243
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion provider/pkg/provider/provider_2e2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion provider/pkg/provider/testdata/autonaming/Pulumi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4104243

Please sign in to comment.