-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
process: start coverage collection before bootstrap #26006
Conversation
This patch moves the dispatch of `Profiler.takePreciseCoverage` to a point before the bootstrap scripts are run to ensure that we can collect coverage data for all the scripts run after the inspector agent is ready. Before this patch `lib/internal/bootstrap/primordials.js` was not covered by `make coverage`, after this patch it is.
This also seems to fix the |
Addressed reviews from @addaleax and fixed the quotes in the warning. Also I notice that sometimes undefined could be written to the file, so I've restored to an approach similar to the previous one and always overwrite the file in the callback once the callback is set. |
})); | ||
const coverageInfo = JSON.parse(msg).result; | ||
writeFileSync(target, JSON.stringify(coverageInfo)); | ||
internalBinding('coverage').end((msg) => { |
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 seems to be async now? should the try/catch be moved to the callback?
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 looks good to me, and I'm excited that we'll be able to collect coverage for a few of the internal libraries we're missing right now.
Before we land this, I'd like to test the branch with a few user-land modules, paying special attention to how subprocesses are handled. I will have cycles to do so this weekend.
explicit V8CoverageSessionDelegate(V8CoverageConnection* connection) | ||
: connection_(connection) {} | ||
|
||
void SendMessageToFrontend( |
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.
nice, seems like a huge benefit to move coverage standup and teardown into C++.
Looks like there are related failures in CI:
|
The failures on Windows:
I'll try looking into it later. (Meanwhile the test probably needs to reverse the order of checks to print something more helpful on failures..) |
quick update, haven't tested on any user-land modules yet; compiling the branch right now and will test tomorrow. |
This is redundant to the platform notification mechanism, and the handle may not be cleaned up util we attempt to close the loop. Refs: nodejs#26089 Refs: nodejs#26006
On Windows, the Platform’s `uv_async_t` may need two iterations before closing when it was previously in use. Refs: nodejs#26089 Refs: nodejs#26006
This is redundant to the platform notification mechanism, and the handle may not be cleaned up util we attempt to close the loop. Refs: #26089 Refs: #26006 PR-URL: #26137 Reviewed-By: Eugene Ostroukhov <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
On Windows, the Platform’s `uv_async_t` may need two iterations before closing when it was previously in use. Refs: #26089 Refs: #26006 PR-URL: #26138 Reviewed-By: Eugene Ostroukhov <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
@addaleax @joyeecheung I apologize for the slow turnaround, I've tested this change on a few user-land modules and it's working great 👍 as soon as tests pass, +1 from me. |
Added |
Landed in 2ae45d3 |
This patch moves the dispatch of `Profiler.takePreciseCoverage` to a point before the bootstrap scripts are run to ensure that we can collect coverage data for all the scripts run after the inspector agent is ready. Before this patch `lib/internal/bootstrap/primordials.js` was not covered by `make coverage`, after this patch it is. PR-URL: #26006 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Coe <[email protected]> Reviewed-By: James M Snell <[email protected]>
This is redundant to the platform notification mechanism, and the handle may not be cleaned up util we attempt to close the loop. Refs: #26089 Refs: #26006 PR-URL: #26137 Reviewed-By: Eugene Ostroukhov <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
On Windows, the Platform’s `uv_async_t` may need two iterations before closing when it was previously in use. Refs: #26089 Refs: #26006 PR-URL: #26138 Reviewed-By: Eugene Ostroukhov <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
This patch moves the dispatch of `Profiler.takePreciseCoverage` to a point before the bootstrap scripts are run to ensure that we can collect coverage data for all the scripts run after the inspector agent is ready. Before this patch `lib/internal/bootstrap/primordials.js` was not covered by `make coverage`, after this patch it is. PR-URL: #26006 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Coe <[email protected]> Reviewed-By: James M Snell <[email protected]>
This is redundant to the platform notification mechanism, and the handle may not be cleaned up util we attempt to close the loop. Refs: #26089 Refs: #26006 PR-URL: #26137 Reviewed-By: Eugene Ostroukhov <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
On Windows, the Platform’s `uv_async_t` may need two iterations before closing when it was previously in use. Refs: #26089 Refs: #26006 PR-URL: #26138 Reviewed-By: Eugene Ostroukhov <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
This patch moves the dispatch of `Profiler.takePreciseCoverage` to a point before the bootstrap scripts are run to ensure that we can collect coverage data for all the scripts run after the inspector agent is ready. Before this patch `lib/internal/bootstrap/primordials.js` was not covered by `make coverage`, after this patch it is. PR-URL: #26006 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Coe <[email protected]> Reviewed-By: James M Snell <[email protected]>
This patch moves the dispatch of
Profiler.takePreciseCoverage
to a point before the bootstrap scripts are run to ensure that
we can collect coverage data for all the scripts run after
the inspector agent is ready.
Before this patch
lib/internal/bootstrap/primordials.js
was notcovered by
make coverage
, after this patch it is.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes