-
Notifications
You must be signed in to change notification settings - Fork 4.4k
ci(integration-test-deployment): timeout tests before token expiry #36598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -100,4 +100,26 @@ describe('Run Integration Tests with Atmosphere', () => { | |
|
|
||
| validateSnapshotRun({ batchSize: 3 }); | ||
| }); | ||
|
|
||
| test('failed Atmosphere release requests after timeout creates a warning and proceeds with the next batch', async () => { | ||
| jest.spyOn(integRunner, 'deployIntegrationTest').mockImplementation(() => { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the point of mocking this part?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is to simulate an integration test failure caused by a timeout. This is the same scenario where the original bug occured: https://github.com/aws/aws-cdk/actions/runs/20137124927/job/57793467916#step:12:475 |
||
| return Promise.reject(new Error('Integration tests failed with exit code 1')); | ||
| }); | ||
|
|
||
| jest.spyOn(mockAtmosphereAllocation, 'release').mockImplementation(() => { | ||
| return Promise.reject(new Error('The security token included in the request is expired')); | ||
| }); | ||
|
|
||
| const consoleSpy = jest.spyOn(console, 'warn').mockImplementation(); | ||
|
|
||
| await expect(integRunner.deployIntegTests({ atmosphereRoleArn, endpoint, pool })).rejects.toThrow( | ||
| 'Deployment integration test did not pass', | ||
| ); | ||
|
|
||
| expect(consoleSpy).toHaveBeenCalledWith(expect.stringContaining('::warning::Atmosphere allocation release failed: Error: The security token included in the request is expired')); | ||
|
|
||
| consoleSpy.mockRestore(); | ||
|
|
||
| validateSnapshotRun({ batchSize: 3 }); | ||
| }); | ||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we catch the token expired error only and not all the errors? Otherwise we're going to hide other problems
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree! if we think so then we shouldn't need to release at all. If we think the release is important but we know that there's a specific case isn't important then only catch gracefully this case but not all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I've made the error caught only if it is due to an expired security token.