-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Strange race condition on empy streams #135
Comments
Getting closer to the culprit - seems like the Got the following sample that IMO illustrates what is happening: const readable = new Readable();
nextTick(() => readable.push(null));
pipeline(Readable.from([]), toThrough(readable))
.on('data', () => {})
.on('end', done); // -> never called |
What were you expecting to happen?
I have the following Vitest-based test in my project:
This test should end without any error. However once in a 10 tries it ends up with timeout (running with vitest). There is a switched order of
flush
/end
events in the second vinyl stream. The issue happens more often if the first glob stream actually matches some files.I am still trying to find the root cause - whether it is in streamx, to-through or gulp-stream (already spent 8 hours getting to this point so I am quite exhausted).
Terminal output
Successful run:
Failed run:
Please provide the following information:
Library versions (only Gulp 5.0.0 is in my package.json so the rest is transitive):
Tested on OSX with NodeJS v20.12.2 and on Kubuntu 24.04 with NodeJS v22.3.0.
The text was updated successfully, but these errors were encountered: