Skip to content

Commit

Permalink
chore: integ test flakiness
Browse files Browse the repository at this point in the history
Stacks that are being deployed using roles need to be deleted while the
role is still present. Our test was deleting the role before the stack
was being deleted, and so would fail.

This was a race condition due to a missing `await`.

Fix both.
  • Loading branch information
rix0rrr committed May 21, 2020
1 parent d126c46 commit ab6b994
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/aws-cdk/test/integ/cli/cli.integtest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,12 @@ test('deploy with role', async () => {
options: ['--role-arn', roleArn],
});

// Immediately delete the stack again before we delete the role.
//
// Since roles are sticky, if we delete the role before the stack, subsequent DeleteStack
// operations will fail when CloudFormation tries to assume the role that's already gone.
await cdkDestroy('test-2');

} finally {
deleteRole();
}
Expand Down

0 comments on commit ab6b994

Please sign in to comment.