Skip to content

Commit c29855e

Browse files
authored
fix: longer timeout for notices in the testing environment (#656)
We're observing a lot of these errors in our integration tests: ``` [09:29:38] Could not refresh notices: _ToolkitError: Network error: Request timed out ``` It could be that our timeout is too short on a heavily congested machine. Increase the timeout specifically for those cases to improve the reliability of our tests. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
1 parent 6625d97 commit c29855e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/@aws-cdk-testing/cli-integ/lib/with-cdk-app.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ export class TestFixture extends ShellHelper {
560560
AWS_DEFAULT_REGION: this.aws.region,
561561
STACK_NAME_PREFIX: this.stackNamePrefix,
562562
PACKAGE_LAYOUT_VERSION: '2',
563+
TESTING_CDK: 'true',
563564
// In these tests we want to make a distinction between stdout and sterr
564565
CI: 'false',
565566
...awsCreds,

packages/@aws-cdk/toolkit-lib/lib/api/notices/web-data-source.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ export class WebsiteNoticeDataSource implements NoticeDataSource {
4444
}
4545

4646
async fetch(): Promise<Notice[]> {
47-
const timeout = 3000;
47+
// We are observing lots of timeouts when running in a massively parallel
48+
// integration test environment, so wait for a longer timeout there.
49+
//
50+
// In production, have a short timeout to not hold up the user experience.
51+
const timeout = process.env.TESTING_CDK ? 30_000 : 3_000;
4852

4953
const options: RequestOptions = {
5054
agent: this.agent,

0 commit comments

Comments
 (0)