Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: fix test failures with node v19 change to default http clients to use keep-alive #2803

Merged
merged 1 commit into from
Jul 4, 2022

Conversation

trentm
Copy link
Member

@trentm trentm commented Jul 4, 2022

As of nodejs/node#37184 node v19 and later
defaults the http,https.globalAgent to use keep-alive:

- globalAgent: new Agent()
+ globalAgent: new Agent({ keepAlive: true, scheduling: 'lifo', timeout: 5000 })

This change in default broke a couple tests. The agent itself is
unaffected because our http client already uses a custom http agent
using keep-alive.


This should fix recent Jenkins CI failures in the "Nightly Test" stage.
E.g. https://apm-ci.elastic.co/blue/organizations/jenkins/apm-agent-nodejs%2Fapm-agent-nodejs-mbp/detail/main/267/pipeline/7010

This started failing with the v19.0.0-nightly20220630350a6a8d59 nightly node build which included these node commits:

* 350a6a8d59 - perf_hooks: add initiatorType getter
* a0440c9174 - doc: add `backport-open-vN.x` step to backporting guide
* dc3e5408aa - tools: update lint-md-dependencies
* 49a5e81887 - src: fix compiler warning in src/heap_utils.cc
* ed1e9ae402 - events: improve `EventListener` validation
* 4267b92604 - http: use Keep-Alive by default in global agents
* 8e19dab677 - net: fix net keepalive and noDelay
* e2225ba8e1 - test_runner: expose `describe` and `it`
* d636fee319 - benchmark: fix fork detection

It is commit 4267b92604 - http: use Keep-Alive by default in global agents that was impacted our tests.

… to use keep-alive

As of nodejs/node#37184 node v19 and later
defaults the http,https.globalAgent to use keep-alive:

  - globalAgent: new Agent()
  + globalAgent: new Agent({ keepAlive: true, scheduling: 'lifo', timeout: 5000 })

This change in default broke a couple tests. The agent itself is
unaffected because our http client already uses a custom http agent
using keep-alive.
@trentm trentm self-assigned this Jul 4, 2022
@github-actions github-actions bot added the agent-nodejs Make available for APM Agents project planning. label Jul 4, 2022
@trentm trentm requested a review from astorm July 4, 2022 18:04
@trentm
Copy link
Member Author

trentm commented Jul 4, 2022

@astorm, I know you are off today. To get tests unblocked (there are currently 3 different issues in various test stages :) I will probably go ahead and merge this today once tests pass.

@apmmachine
Copy link
Contributor

apmmachine commented Jul 4, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-07-04T20:06:19.221+0000

  • Duration: 21 min 55 sec

Test stats 🧪

Test Results
Failed 0
Passed 23803
Skipped 0
Total 23803

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run module tests for <modules> : Run TAV tests for one or more modules, where <modules> can be either a comma separated list of modules (e.g. memcached,redis) or the string literal ALL to test all modules

  • run benchmark tests : Run the benchmark test only.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@trentm
Copy link
Member Author

trentm commented Jul 4, 2022

@trentm trentm merged commit 45c2a02 into main Jul 4, 2022
@trentm trentm deleted the trentm/node-v19-http-keep-alive-by-default branch July 4, 2022 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants