Skip to content

Commit ed99219

Browse files
trentmPeterEinberger
authored andcommitted
test: fix s3.test.js failure in Docker on macos due to timeout (elastic#3276)
It was found that running this test in Docker on mac -- e.g. by running `.ci/scripts/test.sh -b release 18` -- would fail. It would hit the set timeout for the `execFile` call. THis bumps the timeout and improves some logging output around that so it is easier to diagnose if it happens again.
1 parent 1a0b589 commit ed99219

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/instrumentation/modules/aws-sdk/s3.test.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ if (process.env.GITHUB_ACTIONS === 'true' && process.platform === 'win32') {
2121
// cannot be tested.
2222

2323
const { execFile } = require('child_process')
24+
const util = require('util')
2425

2526
const tape = require('tape')
2627

@@ -44,20 +45,24 @@ tape.test('simple S3 usage scenario', function (t) {
4445
TEST_REGION: 'us-east-2'
4546
}
4647
t.comment('executing test script with this env: ' + JSON.stringify(additionalEnv))
48+
console.time && console.time('exec use-s3')
4749
execFile(
4850
process.execPath,
4951
['fixtures/use-s3.js'],
5052
{
5153
cwd: __dirname,
52-
timeout: 10000, // sanity guard on the test hanging
54+
timeout: 20000, // sanity guard on the test hanging
55+
maxBuffer: 10 * 1024 * 1024, // This is big, but I don't ever want this to be a failure reason.
5356
env: Object.assign({}, process.env, additionalEnv)
5457
},
5558
function done (err, stdout, stderr) {
59+
console.timeLog && console.timeLog('exec use-s3')
5660
t.error(err, 'use-s3.js did not error out')
5761
if (err) {
58-
t.comment(`use-s3.js stdout:\n${stdout}\n`)
59-
t.comment(`use-s3.js stderr:\n${stderr}\n`)
62+
t.comment('err: ' + util.inspect(err))
6063
}
64+
t.comment(`use-s3.js stdout:\n${stdout}\n`)
65+
t.comment(`use-s3.js stderr:\n${stderr}\n`)
6166
t.ok(server.events[0].metadata, 'APM server got event metadata object')
6267

6368
// Sort the events by timestamp, then work through each expected span.

0 commit comments

Comments
 (0)