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 invalid common.mustSucceed() usage #56756

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lpinca
Copy link
Member

@lpinca lpinca commented Jan 25, 2025

By its own nature, the function returned by common.mustSucceed() cannot be used as a listener for 'error' events.

Write errors like read ECONNRESET or write EPIPE, should be ignored because the socket might be closed by the other peer while the request is sent.

Refs: 3caa2c1a005652fdb3e8

By its own nature, the function returned by `common.mustSucceed()`
cannot be used as a listener for `'error'` events.

Write errors like `read ECONNRESET` or `write EPIPE`, should be ignored
because the socket might be closed by the other peer while the request
is sent.

Refs: nodejs@3caa2c1a005652fdb3e8
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Jan 25, 2025
@lpinca
Copy link
Member Author

lpinca commented Jan 25, 2025

This should address the following failure

---
duration_ms: 6221.41
exitcode: 1
severity: fail
stack: |-
  node:assert:1075
      throw newErr;
      ^

  AssertionError [ERR_ASSERTION]: ifError got unwanted exception: write EPIPE
      at Socket.<anonymous> (/home/iojs/build/workspace/node/test/common/index.js:433:12)
      at Socket.<anonymous> (/home/iojs/build/workspace/node/test/common/index.js:470:15)
      at Socket.emit (node:events:507:28)
      at emitErrorNT (node:internal/streams/destroy:170:8)
      at emitErrorCloseNT (node:internal/streams/destroy:129:3)
      at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
      at afterWriteDispatched (node:internal/stream_base_commons:159:15)
      at writeGeneric (node:internal/stream_base_commons:150:3)
      at Socket._writeGeneric (node:net:971:11)
      at Socket._write (node:net:983:8)
      at writeOrBuffer (node:internal/streams/writable:570:12)
      at _write (node:internal/streams/writable:499:10)
      at Writable.write (node:internal/streams/writable:508:10)
      at Timeout._onTimeout (/home/iojs/build/workspace/node/test/parallel/test-http-server-headers-timeout-delayed-headers.js:57:14)
      at listOnTimeout (node:internal/timers:614:17)
      at process.processTimers (node:internal/timers:549:7) {
    generatedMessage: false,
    code: 'ERR_ASSERTION',
    actual: Error: write EPIPE
        at afterWriteDispatched (node:internal/stream_base_commons:159:15)
        at writeGeneric (node:internal/stream_base_commons:150:3)
        at Socket._writeGeneric (node:net:971:11)
        at Socket._write (node:net:983:8)
        at writeOrBuffer (node:internal/streams/writable:570:12)
        at _write (node:internal/streams/writable:499:10)
        at Writable.write (node:internal/streams/writable:508:10)
        at Timeout._onTimeout (/home/iojs/build/workspace/node/test/parallel/test-http-server-headers-timeout-delayed-headers.js:57:14)
        at listOnTimeout (node:internal/timers:614:17)
        at process.processTimers (node:internal/timers:549:7) {
      errno: -32,
      code: 'EPIPE',
      syscall: 'write'
    },
    expected: null,
    operator: 'ifError'
  }

  Node.js v24.0.0-pre
...

Build link: https://ci.nodejs.org/job/node-test-commit-linux/62793/nodes=alpine-latest-x64/testReport/junit/(root)/parallel/test_http_server_headers_timeout_delayed_headers/

@lpinca lpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 25, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 25, 2025
@nodejs-github-bot
Copy link
Collaborator

lpinca added a commit to lpinca/node that referenced this pull request Jan 25, 2025
Reduce chances of write errors while the request is sent.

Refs: nodejs#56756
Copy link

codecov bot commented Jan 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.21%. Comparing base (1760024) to head (ec5b67f).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #56756   +/-   ##
=======================================
  Coverage   89.20%   89.21%           
=======================================
  Files         662      662           
  Lines      192124   192124           
  Branches    36972    36976    +4     
=======================================
+ Hits       171390   171406   +16     
+ Misses      13559    13549   -10     
+ Partials     7175     7169    -6     

see 25 files with indirect coverage changes

@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. labels Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants