-
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
worker: improve code coverage #41818
worker: improve code coverage #41818
Conversation
It's useful (or at least I think it is!) in PRs to increase code coverage to include a
Following that link will highlight line 85 of round_robin_handle.js which is currently not covered. Putting that at the end of the commit message would be great. |
Perfect! Just added it to the PR, should I add it to the commit as well? |
FWIW these are not permanent links -- we do not have the disk space to contain coverage data indefinitely. |
I think adding them to the PR is enough. The commit will end up having a link to the PR anyway. And as Richard Lau pointed out, these links are not permanent, so it's probably fine to not have them in the commit message, contrary to my earlier suggestion. |
Signed-off-by: Erick Wendel <erick.workspace@gmail.com>
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 work!
(async () => { | ||
const worker = new Worker('setInterval(() => {}, 1000);', { eval: true }); | ||
await once(worker, 'online'); | ||
const stream = await worker.getHeapSnapshot(); |
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.
Hope this one isn't flaky like the other one
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.
@benjamingr @Trott which one was that? I was talking with @ErickWendel today and I might have some idea of what the problem was/is
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.
Looks like it was already fixed #41204 ?
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.
Hm, that test is actually very very similar to this one. That also means that I’m wrong about having an idea about the cause of the flakiness :)
Landed in ba5b5ac |
PR-URL: nodejs#41818 Refs: https://coverage.nodejs.org/coverage-7123a00b03a90862/lib/internal/worker.js.html#L412 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#41818 Refs: https://coverage.nodejs.org/coverage-7123a00b03a90862/lib/internal/worker.js.html#L412 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Added the |
PR-URL: #41818 Refs: https://coverage.nodejs.org/coverage-7123a00b03a90862/lib/internal/worker.js.html#L412 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #41818 Refs: https://coverage.nodejs.org/coverage-7123a00b03a90862/lib/internal/worker.js.html#L412 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #41818 Refs: https://coverage.nodejs.org/coverage-7123a00b03a90862/lib/internal/worker.js.html#L412 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
I had to remove this commit from v16.x-staging as the test crashes there in debug mode. Probably a bug in V8. |
It adds tests for the worker getHeadSnapshot function and assignEnvironmentData
Refs: lib/internal/worker.js.html#L412 and lib/internal/worker.js.html#L114