Skip to content

Commit cc97912

Browse files
authored
fix(tests): improve CloudFormation changeset error handling and timeout (#7073)
1 parent 23b1dbc commit cc97912

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

tests/e2e/ensure-test-stack.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,16 @@ exports.ensureTestStack = async (client, stackName, templateBody) => {
4343

4444
try {
4545
// TODO: Feature Request: return the last describe response from the waiter result, so we can inspect failure reasons.
46-
await waitUntilChangeSetCreateComplete({ client }, { ChangeSetName: Id });
46+
await waitUntilChangeSetCreateComplete({ client, maxWaitTime: 300 }, { ChangeSetName: Id });
4747
} catch (e) {
48-
const { Status, StatusReason } = await client.send(
49-
new DescribeChangeSetCommand({
50-
StackName: stackName,
51-
ChangeSetName: Id,
52-
})
53-
);
48+
const { Status, StatusReason = "" } = await client
49+
.send(
50+
new DescribeChangeSetCommand({
51+
StackName: stackName,
52+
ChangeSetName: Id,
53+
})
54+
)
55+
.catch((e) => console.warn("Failed to describe changeset", e));
5456
if (Status === "FAILED" && StatusReason.includes("The submitted information didn't contain changes")) {
5557
await client
5658
.send(

0 commit comments

Comments
 (0)