-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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: wait for stream finish when --test-force-exit #54953
Conversation
Review requested:
|
@@ -18,6 +18,7 @@ class TestsStream extends Readable { | |||
objectMode: true, | |||
highWaterMark: NumberMAX_SAFE_INTEGER, | |||
}); | |||
this.streams = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is introducing new public API that I don't think we want to support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can redo it with a symbol / _? Unless you know a better way to wait for the streams?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, it doesn't need to be attached to the stream at all. For example, the reporterScope
object is internal and could hold them (you would need to make sure it works with watch mode though).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO attaching to the stream makes the most sense, it's the.. well... stream.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #54953 +/- ##
=======================================
Coverage 88.06% 88.07%
=======================================
Files 652 652
Lines 183545 183558 +13
Branches 35854 35859 +5
=======================================
+ Hits 161648 161670 +22
+ Misses 15146 15143 -3
+ Partials 6751 6745 -6
|
339ef9c
to
3158d98
Compare
3158d98
to
167c225
Compare
167c225
to
2e11df6
Compare
compose(rootReporter, reporter).pipe(destination); | ||
const stream = compose(rootReporter, reporter); | ||
stream.pipe(destination); | ||
ArrayPrototypePush(rootReporter[kReporterStreams], destination); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cjihrig the issue was that I was originally appending stream
, not destination
.
It appears now it's waiting too long 😅 . It looks like it's waiting for the schedule to complete, I wonder why? Maybe they are |
What exactly is ref'ed that you unref'ed? Unfortunately, A few things to look into:
|
@redyetidev are you still working on this? I noticed you have 36(!) open PRs on the project. I think it would be in everyone's best interest to either close some, or focus on getting them merged. Having so many open PRs is a lot of cognitive overhead and prevents other people from fixing the issues. |
No, someone else can take on the work. I'm aware I have many many open PRs, and I'm working on getting them closed in a way that benefits the entire community. 😅 I'm sorry for all my open PRs, I got a bit carried away, and your right that it takes a lot of effort to keep open. I've closed some, and I'll refrain from opening any more until I close/land some more. Thanks for your help :-) |
Fixes #54327.
This PR stores the reporter streams inside of
TestsStream
, and waits for them to finish before exitting the process.