stream: fix eventNames() to not return not defined events#51331
stream: fix eventNames() to not return not defined events#51331nodejs-github-bot merged 1 commit intonodejs:mainfrom
Conversation
34542ca to
bf229ca
Compare
|
Yep, that's basically what I had in mind. I'd maybe make it check if it's an array and non-empty though to be more accurate rather than just the simple check that it's not undefined. Can you add some tests? 🙂 |
benjamingr
left a comment
There was a problem hiding this comment.
LGTM, please add a test :]
9a4ba8d to
0c7adfc
Compare
Qard
left a comment
There was a problem hiding this comment.
LGTM, but a suggestion: the tests currently rely on the implementation detail of streams doing the _events pre-allocation. It may be a good idea to manually reproduce the behaviour on a plain event listener as streams could change in the future to not do that anymore. 🤔
|
I wonder if it is better to override |
0c7adfc to
05c64c3
Compare
@lpinca I agree with you, this is related to Stream not EventEmitter, I pushed the changes, could you please check again ? |
05c64c3 to
feb07ec
Compare
|
I think flaky tests 🤔 no ? |
|
Yes. |
|
Failed on this one wasi/test-wasi # TODO : Fix flaky test |
feb07ec to
cea8fe3
Compare
cea8fe3 to
2bbe1f6
Compare
Commit Queue failed- Loading data for nodejs/node/pull/51331 ✔ Done loading data for nodejs/node/pull/51331 ----------------------------------- PR info ------------------------------------ Title stream: fix eventNames() to not return not defined events (#51331) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch IlyasShabi:stream-event-names -> nodejs:main Labels events, needs-ci Commits 1 - stream: fix eventNames() to not return not defined events Committers 1 - Ilyas Shabi PR-URL: https://github.com/nodejs/node/pull/51331 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Stephen Belanger Reviewed-By: Luigi Pinca ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/51331 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Stephen Belanger Reviewed-By: Luigi Pinca -------------------------------------------------------------------------------- ⚠ Commits were pushed since the last approving review: ⚠ - stream: fix eventNames() to not return not defined events ℹ This PR was created on Mon, 01 Jan 2024 12:43:44 GMT ✔ Approvals: 3 ✔ - Benjamin Gruenbaum (@benjamingr) (TSC): https://github.com/nodejs/node/pull/51331#pullrequestreview-1799869531 ✔ - Stephen Belanger (@Qard): https://github.com/nodejs/node/pull/51331#pullrequestreview-1890807762 ✔ - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/51331#pullrequestreview-1890926622 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2024-02-27T21:35:07Z: https://ci.nodejs.org/job/node-test-pull-request/57477/ - Querying data for job/node-test-pull-request/57477/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/8072630772 |
|
Landed in a51efa2 |
PR-URL: #51331 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #51331 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #51331 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #51331 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: nodejs#51331 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Fix issue #51302
As explained by @Qard, the root cause is that by default, we pre-allocate events here here
I did different tests like:
I will add tests as soon as I can