diff --git a/tests/functional/aws-node-sdk/test/support/config.js b/tests/functional/aws-node-sdk/test/support/config.js index d18294a71f..92cb5dc868 100644 --- a/tests/functional/aws-node-sdk/test/support/config.js +++ b/tests/functional/aws-node-sdk/test/support/config.js @@ -22,15 +22,23 @@ const DEFAULT_GLOBAL_OPTIONS = { httpOptions, }; +// The SDK v2 config set no timeout, so tests ran with the v2 default of +// 120s; the v3 migration introduced a 5s timeout that heavy server-side +// operations (multi-megabyte UploadPartCopy, 1000-key batch deletes) exceed +// under CI load, as the server sends no response bytes until they complete. +// 30s stays below mocha's 40s global timeout so a genuine hang still +// surfaces as the SDK TimeoutError rather than a generic mocha timeout. +const REQUEST_TIMEOUT = 30000; + const DEFAULT_MEM_OPTIONS = { endpoint: `${transport}://127.0.0.1:8000`, port: 8000, forcePathStyle: true, - region: 'us-east-1', + region: 'us-east-1', maxAttempts: 3, requestHandler: new NodeHttpHandler({ connectionTimeout: 5000, - requestTimeout: 5000, + requestTimeout: REQUEST_TIMEOUT, httpAgent: new (ssl ? https : http).Agent({ maxSockets: 200, keepAlive: true, @@ -44,7 +52,7 @@ const DEFAULT_AWS_OPTIONS = { maxAttempts: 3, requestHandler: new NodeHttpHandler({ connectionTimeout: 5000, - socketTimeout: 5000, + requestTimeout: REQUEST_TIMEOUT, httpAgent: new https.Agent({ maxSockets: 200, keepAlive: true, @@ -64,9 +72,7 @@ function _getMemCredentials(profile) { function _getMemConfig(profile, config) { const credentials = _getMemCredentials(profile); - const memConfig = Object.assign({} - , DEFAULT_GLOBAL_OPTIONS, DEFAULT_MEM_OPTIONS - , { credentials }, config); + const memConfig = Object.assign({}, DEFAULT_GLOBAL_OPTIONS, DEFAULT_MEM_OPTIONS, { credentials }, config); if (process.env.IP) { memConfig.endpoint = `${transport}://${process.env.IP}:8000`; @@ -78,9 +84,7 @@ function _getMemConfig(profile, config) { function _getAwsConfig(profile, config) { const credentials = getAwsCredentials(profile); - const awsConfig = Object.assign({} - , DEFAULT_GLOBAL_OPTIONS, DEFAULT_AWS_OPTIONS - , { credentials }, config); + const awsConfig = Object.assign({}, DEFAULT_GLOBAL_OPTIONS, DEFAULT_AWS_OPTIONS, { credentials }, config); return awsConfig; }