Skip to content

"azure-functions.test.js" test failure: Syntax error: "(" unexpected #3279

@trentm

Description

@trentm

Recently, there has been a new failure in the azure-functions test:

node_tests_1     | running test: cd . && node --unhandled-rejections=strict test/instrumentation/azure-functions/azure-functions.test.js > test_output/test-instrumentation-azure-functions-azure-functions.test.js.tap 2&>1
node_tests_1     |
node_tests_1     | TAP version 13
node_tests_1     | # SKIP setup: npm ci (in /app/test/instrumentation/azure-functions/fixtures/AJsAzureFnApp)
node_tests_1     | # azure functions
node_tests_1     | # setup
node_tests_1     | # mock APM apmServerUrl: http://localhost:43399
node_tests_1     | # setup: "func start" for AJsAzureFnApp fixture
node_tests_1     | # ["func start" stderr] /app/test/instrumentation/azure-functions/fixtures/AJsAzureFnApp/node_modules/azure-functions-core-tools/bin/func: 1: Syntax error: "(" unexpected
node_tests_1     | not ok 1 "func start" failed early: code=2
node_tests_1     |   ---
node_tests_1     |     operator: fail
node_tests_1     |     at: ChildProcess.onEarlyClose (/app/test/instrumentation/azure-functions/azure-functions.test.js:484:9)
node_tests_1     |     stack: |-
node_tests_1     |       Error: "func start" failed early: code=2
node_tests_1     |           at Test.assert [as _assert] (/app/node_modules/tape/lib/test.js:312:48)
node_tests_1     |           at Test.bound [as _assert] (/app/node_modules/tape/lib/test.js:95:17)
node_tests_1     |           at Test.fail (/app/node_modules/tape/lib/test.js:406:7)
node_tests_1     |           at Test.bound [as fail] (/app/node_modules/tape/lib/test.js:95:17)
node_tests_1     |           at ChildProcess.onEarlyClose (/app/test/instrumentation/azure-functions/azure-functions.test.js:484:9)
node_tests_1     |           at ChildProcess.emit (node:events:513:28)
node_tests_1     |           at maybeClose (node:internal/child_process:1091:16)
node_tests_1     |           at ChildProcess._handle.onexit (node:internal/child_process:302:5)
node_tests_1     |   ...
node_tests_1     | # make requests
node_tests_1     | ok 2 there is no fnAppProc # SKIP
node_tests_1     | # check all APM events
node_tests_1     | ok 3 there is no fnAppProc # SKIP
node_tests_1     | # teardown
node_tests_1     |
node_tests_1     | 1..3
node_tests_1     | # tests 3
node_tests_1     | # pass  2
node_tests_1     | # fail  1
node_tests_1     |
node_tests_1     |
node_tests_1     | /app/test/test.js:224
node_tests_1     |     if (err) throw err
node_tests_1     |              ^
node_tests_1     |
node_tests_1     | Error: non-zero error code
node_tests_1     |     at WriteStream.onClose (/app/test/test.js:86:25)
node_tests_1     |     at WriteStream.emit (node:events:513:28)
node_tests_1     |     at emitCloseNT (node:internal/streams/destroy:132:10)
node_tests_1     |     at process.processTicksAndRejections (node:internal/process/task_queues:81:21) {
node_tests_1     |   code: 'ENONZERO',
node_tests_1     |   exitCode: 1
node_tests_1     | }

This started happening yesterday on the #3274 PR, e.g. https://github.com/elastic/apm-agent-nodejs/actions/runs/4753789197/jobs/8450388109

It is reproducible in a docker test run via: .ci/scripts/test.sh -b release 18. I'm not yet sure if it is related to Node v18... or perhaps a particular version of node v18. The main relevant error output is:

node_tests_1     | # ["func start" stderr] /app/test/instrumentation/azure-functions/fixtures/AJsAzureFnApp/node_modules/azure-functions-core-tools/bin/func: 1: Syntax error: "(" unexpected
node_tests_1     | not ok 1 "func start" failed early: code=2

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions