Skip to content

Commit b20be35

Browse files
committed
add reasonable timeout
1 parent 75cdeb6 commit b20be35

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/@aws-cdk/toolkit-lib/lib/api/network-detector/network-detector.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ export class NetworkDetector {
4646
}
4747
}
4848

49-
// private static readonly TIMEOUT_MS = 500;
49+
// We are observing lots of timeouts when running in a massively parallel
50+
// integration test environment, so wait for a longer timeout there.
51+
//
52+
// In production, have a short timeout to not hold up the user experience.
53+
private static readonly TIMEOUT = process.env.TESTING_CDK ? 30_000 : 3_000;
5054
private static readonly URL = 'https://cli.cdk.dev-tools.aws.dev/notices.json';
5155

5256
private static async load(): Promise<CachedConnectivity> {
@@ -77,7 +81,7 @@ export class NetworkDetector {
7781
const options: RequestOptions = {
7882
method: 'HEAD',
7983
agent: agent,
80-
// timeout: this.TIMEOUT_MS,
84+
timeout: this.TIMEOUT,
8185
};
8286

8387
return new Promise((resolve) => {

0 commit comments

Comments
 (0)