-
Notifications
You must be signed in to change notification settings - Fork 232
Description
In #3071 the "azure-functions-core-tools" package was added to the top-level "devDependencies". This dep installs a func
CLI tool that is used for test/instrumentation/azure-functions/azure-functions.test.js
to run (running Azure Functions locally). This package has a postinstall step that downloads a large support package -- on the order of a couple hundred MBs.
After this merged to main, it was noticed that the Jenkins Windows CI failed a number of times with:
...
[2023-01-17T18:14:15.071Z] > [email protected] postinstall C:\Users\jenkins\workspace\main-575-b9426742-7d40-4659-89fb-27ecdcc35fc2\src\github.com\elastic\apm-agent-nodejs\node_modules\azure-functions-core-tools
[2023-01-17T18:14:15.071Z] > node lib/install.js
[2023-01-17T18:14:15.071Z]
[2023-01-17T18:14:15.377Z] attempting to GET "https://functionscdn.azureedge.net/public/4.0.4915/Azure.Functions.Cli.win-x64.4.0.4915.zip"
[2023-01-17T18:14:34.518Z] Error: read ECONNRESET
[2023-01-17T18:14:37.151Z] npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
[2023-01-17T18:14:37.151Z] npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
[2023-01-17T18:14:37.151Z]
[2023-01-17T18:14:37.151Z] npm ERR! code ELIFECYCLE
[2023-01-17T18:14:37.151Z] npm ERR! errno 1
[2023-01-17T18:14:37.151Z] npm ERR! [email protected] postinstall: `node lib/install.js`
[2023-01-17T18:14:37.152Z] npm ERR! Exit status 1
[2023-01-17T18:14:37.152Z] npm ERR!
[2023-01-17T18:14:37.152Z] npm ERR! Failed at the [email protected] postinstall script.
[2023-01-17T18:14:37.152Z] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
...
Currently this issue is to track such failures to see if we want/need to deal with it.
A weird side-effect of this failure: Currently the test run with retry the npm install
. In the cases below (so far), the second npm install
passes, then the tests fail. The test failure is in the "http2" tests. This failure is actually likely due to the first npm install
failure, because the "https-pem" devDependency post install script somehow now wasn't run -- at least not run properly -- such that there isn't a pem file to use for http2/https testing.
noticed failures
- https://apm-ci.elastic.co/blue/organizations/jenkins/apm-agent-nodejs%2Fapm-agent-nodejs-mbp/detail/PR-3103/2/pipeline
- https://apm-ci.elastic.co/blue/organizations/jenkins/apm-agent-nodejs%2Fapm-agent-nodejs-mbp/detail/main/575/pipeline
- https://apm-ci.elastic.co/blue/organizations/jenkins/apm-agent-nodejs%2Fapm-agent-nodejs-mbp/detail/main/574/pipeline
- https://apm-ci.elastic.co/blue/organizations/jenkins/apm-agent-nodejs%2Fapm-agent-nodejs-mbp/detail/main/572/pipeline
possible fix/workaround options
If this becomes too-frequent of a flaky-test issue then some possible options are:
- Move the dep to the fixture at "test/instrumentation/azure-functions/fixtures/AJsAzureFnApp/package.json" (currently possible because we currently only have a single test Azure Function app fixture),
npm install
manually in "test/instrumentation/azure-functions/azure-functions.test.js" on first run, skip running tests on Windows. - Ditto, but retry the "npm install" one or more times on failure.
So far, if this tends to be a failure only for Windows CI, then I prefer option 1.