Skip to content

test: deflake stream-readable-to-web test #58948

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Ethan-Arrowood
Copy link
Contributor

@Ethan-Arrowood Ethan-Arrowood commented Jul 3, 2025

Fixes: #58949

@Ethan-Arrowood Ethan-Arrowood added the flaky-test Issues and PRs related to the tests with unstable failures on the CI. label Jul 3, 2025
@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 Jul 3, 2025
@Ethan-Arrowood
Copy link
Contributor Author

cc @nodejs/streams

@Ethan-Arrowood Ethan-Arrowood added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 3, 2025
@github-actions github-actions bot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Jul 3, 2025
Copy link
Contributor

github-actions bot commented Jul 3, 2025

Failed to start CI
   ⚠  No approving reviews found
   ✘  Refusing to run CI on potentially unsafe PR
https://github.com/nodejs/node/actions/runs/16055944616

@Ethan-Arrowood
Copy link
Contributor Author

I guess I appreciate the CI not running without a review lol

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. labels Jul 3, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 3, 2025
@nodejs-github-bot
Copy link
Collaborator

lpinca
lpinca previously approved these changes Jul 3, 2025
@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 3, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 3, 2025
@nodejs-github-bot
Copy link
Collaborator

Copy link

codecov bot commented Jul 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.06%. Comparing base (1c4fe6d) to head (5b5f9dc).
Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #58948      +/-   ##
==========================================
- Coverage   90.08%   90.06%   -0.02%     
==========================================
  Files         641      641              
  Lines      188718   188718              
  Branches    37022    37025       +3     
==========================================
- Hits       170000   169965      -35     
- Misses      11417    11462      +45     
+ Partials     7301     7291      -10     

see 33 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Ethan-Arrowood
Copy link
Contributor Author

@targos
Copy link
Member

targos commented Jul 3, 2025

@Ethan-Arrowood The problem is that all static imports will be evaluated before your condition (it doesn't matter where they are in the file).

@Ethan-Arrowood
Copy link
Contributor Author

I had a feeling that was it. Doesn't seem like we have any other occurrences of this in our tests. I could switch back to CJS if that is preferred, or I think a dynamic import is okay?

@lpinca
Copy link
Member

lpinca commented Jul 3, 2025

Going back to cjs would make the diff useful. It currently looks like a new test.

@Ethan-Arrowood
Copy link
Contributor Author

My preference is to move towards using ESM but if anyone else feels strongly it should stay as CJS I will happily switch back. Just let me know if that is what is wanted

@Ethan-Arrowood Ethan-Arrowood added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 3, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 3, 2025
@nodejs-github-bot
Copy link
Collaborator

@Ethan-Arrowood
Copy link
Contributor Author

  1. node:test is not needed, will remove.

  2. You're also right - i think an empty buffer will be okay too. Modifying now

  3. I'll work on timing so that the read happens after some delay. But I do believe the flakiness had to do with the plethora of timers so I was trying to reduce that as much as possible.

checkMemoryUsage();
// eslint-disable-next-line no-unused-vars
for await (const _ of randomWebStream) {
// Yield event loop to allow garbage collection
Copy link
Member

Choose a reason for hiding this comment

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

FWIW, this behavior likely relies on the bug described in #54918 - the event loop is not supposed to block on just any garbage collection, which can cause a deadlock, and in the future it might go away (if someone manages to eradicate the deadlock by rewriting the task runner).

Alternatively if there's a specific leaky object with a known class that this tries to test, checkIfCollectableByCounting() from test/common/gc.js might be less flaky. Though I can't really tell whether that's applicable from a look of this test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good to know. I agree that issue seems related here; particularly with the previous heavy use of timers. I believe that the Readable / GC is doing what they are supposed to regarding memory management.

@Ethan-Arrowood Ethan-Arrowood added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 7, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 7, 2025
@nodejs-github-bot
Copy link
Collaborator

@Ethan-Arrowood Ethan-Arrowood force-pushed the deflake-stream-readable-to-web branch from f728218 to 4cd524b Compare July 8, 2025 17:03
@Ethan-Arrowood
Copy link
Contributor Author

Please rereview when you get a chance; I rebased on main so that CI might play nicer. I was only hitting other flaky test haha

@Ethan-Arrowood Ethan-Arrowood force-pushed the deflake-stream-readable-to-web branch from 4cd524b to 5b5f9dc Compare July 8, 2025 17:06
@Ethan-Arrowood Ethan-Arrowood added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 8, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 8, 2025
@nodejs-github-bot
Copy link
Collaborator

@Ethan-Arrowood Ethan-Arrowood added the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 9, 2025
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jul 9, 2025
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/58948
✔  Done loading data for nodejs/node/pull/58948
----------------------------------- PR info ------------------------------------
Title      test: deflake stream-readable-to-web test (#58948)
Author     Ethan Arrowood <[email protected]> (@Ethan-Arrowood)
Branch     Ethan-Arrowood:deflake-stream-readable-to-web -> nodejs:main
Labels     test, flaky-test, needs-ci
Commits    3
 - test: deflake stream-readable-to-web test
 - test: dynamic import cypto
 - test: simplify but keep accurate
Committers 1
 - Ethan Arrowood <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/58948
Fixes: https://github.com/nodejs/node/issues/58949
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Mattias Buelens <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/58948
Fixes: https://github.com/nodejs/node/issues/58949
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Mattias Buelens <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Thu, 03 Jul 2025 16:29:25 GMT
   ✔  Approvals: 5
   ✔  - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/58948#pullrequestreview-2983898238
   ✔  - Mattias Buelens (@MattiasBuelens): https://github.com/nodejs/node/pull/58948#pullrequestreview-2983969659
   ✔  - Juan José Arboleda (@juanarbol): https://github.com/nodejs/node/pull/58948#pullrequestreview-2984451374
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/58948#pullrequestreview-2985657415
   ✔  - Zeyu "Alex" Yang (@himself65): https://github.com/nodejs/node/pull/58948#pullrequestreview-2989658746
   ✘  Last GitHub CI failed
   ℹ  Last Full PR CI on 2025-07-08T19:35:38Z: https://ci.nodejs.org/job/node-test-pull-request/67889/
- Querying data for job/node-test-pull-request/67889/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/16181664591

@Ethan-Arrowood Ethan-Arrowood added request-ci Add this label to start a Jenkins CI on a PR. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Jul 9, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 9, 2025
@nodejs-github-bot
Copy link
Collaborator

@Ethan-Arrowood Ethan-Arrowood added the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 10, 2025
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jul 10, 2025
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/58948
✔  Done loading data for nodejs/node/pull/58948
----------------------------------- PR info ------------------------------------
Title      test: deflake stream-readable-to-web test (#58948)
Author     Ethan Arrowood <[email protected]> (@Ethan-Arrowood)
Branch     Ethan-Arrowood:deflake-stream-readable-to-web -> nodejs:main
Labels     test, flaky-test, needs-ci
Commits    3
 - test: deflake stream-readable-to-web test
 - test: dynamic import cypto
 - test: simplify but keep accurate
Committers 1
 - Ethan Arrowood <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/58948
Fixes: https://github.com/nodejs/node/issues/58949
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Mattias Buelens <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/58948
Fixes: https://github.com/nodejs/node/issues/58949
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Mattias Buelens <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Thu, 03 Jul 2025 16:29:25 GMT
   ✔  Approvals: 5
   ✔  - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/58948#pullrequestreview-2983898238
   ✔  - Mattias Buelens (@MattiasBuelens): https://github.com/nodejs/node/pull/58948#pullrequestreview-2983969659
   ✔  - Juan José Arboleda (@juanarbol): https://github.com/nodejs/node/pull/58948#pullrequestreview-2984451374
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/58948#pullrequestreview-2985657415
   ✔  - Zeyu "Alex" Yang (@himself65): https://github.com/nodejs/node/pull/58948#pullrequestreview-2989658746
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2025-07-09T22:57:46Z: https://ci.nodejs.org/job/node-test-pull-request/67916/
- Querying data for job/node-test-pull-request/67916/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
- Downloading patch for 58948
From https://github.com/nodejs/node
 * branch                  refs/pull/58948/merge -> FETCH_HEAD
✔  Fetched commits as c44fa8d0b65d..5b5f9dc85b63
--------------------------------------------------------------------------------
[main f797193ad8] test: deflake stream-readable-to-web test
 Author: Ethan Arrowood <[email protected]>
 Date: Thu Jul 3 10:27:03 2025 -0600
 2 files changed, 69 insertions(+), 62 deletions(-)
 delete mode 100644 test/parallel/test-stream-readable-to-web.js
 create mode 100644 test/parallel/test-stream-readable-to-web.mjs
[main 1eca5dbc83] test: dynamic import cypto
 Author: Ethan Arrowood <[email protected]>
 Date: Thu Jul 3 13:30:28 2025 -0600
 1 file changed, 54 insertions(+), 48 deletions(-)
[main 15def1f185] test: simplify but keep accurate
 Author: Ethan Arrowood <[email protected]>
 Date: Thu Jul 3 15:43:55 2025 -0600
 1 file changed, 36 insertions(+), 47 deletions(-)
   ✔  Patches applied
There are 3 commits in the PR. Attempting autorebase.
Rebasing (2/6)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
test: deflake stream-readable-to-web test

Co-authored-by: Luigi Pinca <[email protected]>
PR-URL: #58948
Fixes: #58949
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Mattias Buelens <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>

[detached HEAD e8edf49e2b] test: deflake stream-readable-to-web test
Author: Ethan Arrowood <[email protected]>
Date: Thu Jul 3 10:27:03 2025 -0600
2 files changed, 69 insertions(+), 62 deletions(-)
delete mode 100644 test/parallel/test-stream-readable-to-web.js
create mode 100644 test/parallel/test-stream-readable-to-web.mjs
Rebasing (3/6)
Rebasing (4/6)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
test: dynamic import cypto

PR-URL: #58948
Fixes: #58949
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Mattias Buelens <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>

[detached HEAD 0b2dba40da] test: dynamic import cypto
Author: Ethan Arrowood <[email protected]>
Date: Thu Jul 3 13:30:28 2025 -0600
1 file changed, 54 insertions(+), 48 deletions(-)
Rebasing (5/6)
Rebasing (6/6)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
test: simplify but keep accurate

PR-URL: #58948
Fixes: #58949
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Mattias Buelens <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>

[detached HEAD 936c7f6cc9] test: simplify but keep accurate
Author: Ethan Arrowood <[email protected]>
Date: Thu Jul 3 15:43:55 2025 -0600
1 file changed, 36 insertions(+), 47 deletions(-)
Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/16201169771

@Ethan-Arrowood Ethan-Arrowood added commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Jul 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. flaky-test Issues and PRs related to the tests with unstable failures on the CI. 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.

Investigate flaky test parallel/test-stream-readable-to-web.js
9 participants