Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions tests/functional/aws-node-sdk/test/support/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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`;
Expand All @@ -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;
}
Expand Down
Loading