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

test: fix 'localhost' ipv4 vs. ipv6 test failures in GH actions TAV tests #4085

Merged
merged 3 commits into from
Jun 17, 2024

Conversation

trentm
Copy link
Member

@trentm trentm commented Jun 13, 2024

A number of TAV tests started failing in GH Actions recently, starting on Jun 12, 2024 (see x's at https://github.com/elastic/apm-agent-nodejs/commits/main/).

For example https://github.com/elastic/apm-agent-nodejs/actions/runs/9503644674

Screenshot 2024-06-13 at 12 38 33 PM

The failures were all of this basic form:

 node_tests-1  | -- running test "node test/instrumentation/modules/hapi/hapi.test.js" with @hapi/hapi (env: {})
node_tests-1  | node:events:497
node_tests-1  |       throw er; // Unhandled 'error' event
node_tests-1  |       ^
node_tests-1  | 
node_tests-1  | Error: connect ECONNREFUSED 127.0.0.1:33547
node_tests-1  |     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1606:16)
node_tests-1  | Emitted 'error' event on ClientRequest instance at:
node_tests-1  |     at Socket.socketErrorListener (node:_http_client:500:9)
node_tests-1  |     at Socket.emit (node:events:519:28)
node_tests-1  |     at emitErrorNT (node:internal/streams/destroy:169:8)
node_tests-1  |     at emitErrorCloseNT (node:internal/streams/destroy:128:3)
node_tests-1  |     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
node_tests-1  |   errno: -111,
node_tests-1  |   code: 'ECONNREFUSED',
node_tests-1  |   syscall: 'connect',
node_tests-1  |   address: '127.0.0.1',
node_tests-1  |   port: 33547
node_tests-1  | }
  • running some test (on node 18, 20, or 22)
  • start some HTTP server
  • error Error: connect ECONNREFUSED 127.0.0.1:${someport}

The tests were not failing locally for me on my dev macOS.
My guess is that this is about ambiguity over whether localhost is IPv4 (127.0.0.1) or IPv6 (::1).

@trentm trentm self-assigned this Jun 13, 2024
@trentm
Copy link
Member Author

trentm commented Jun 13, 2024

/test tav @opentelemetry/api

Copy link
Member Author

@trentm trentm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/test tav @opentelemetry/api

Copy link
Member Author

@trentm trentm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/test tav @opentelemetry/api,next,@hapi/hapi

@trentm trentm requested a review from david-luna June 13, 2024 20:08
@trentm trentm merged commit a09059e into main Jun 17, 2024
33 checks passed
@trentm trentm deleted the trentm/gh-actions-ECONNREFUSED-errors branch June 17, 2024 16:04
PeterEinberger pushed a commit to fpm-git/apm-agent-nodejs that referenced this pull request Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants