net: do not add multiple `connect` and `finish` listeners when multiple `Socket.destroySoon`'s were scheduled
Fixes https://github.com/nodejs/node/issues/60456 by adding new finish event listener after socket.destroySoon call only if they were not added previously on given socket.
Review requested:
- [ ] @nodejs/net
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 88.54%. Comparing base (fb34515) to head (c9a2c5e).
:warning: Report is 300 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #60469 +/- ##
==========================================
- Coverage 88.58% 88.54% -0.05%
==========================================
Files 704 704
Lines 207826 207886 +60
Branches 40054 40050 -4
==========================================
- Hits 184106 184071 -35
- Misses 15761 15844 +83
- Partials 7959 7971 +12
| Files with missing lines | Coverage Δ | |
|---|---|---|
| lib/net.js | 95.29% <100.00%> (+0.01%) |
:arrow_up: |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
CI: https://ci.nodejs.org/job/node-test-pull-request/70283/
Hi :) I suppose that tests do not pass because of flakiness :/ May I please to add request-ci label by someone with such privilege?
CI: https://ci.nodejs.org/job/node-test-pull-request/70389/