-
Notifications
You must be signed in to change notification settings - Fork 91
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
bug: finally block in async function indicates incorrect missing block coverage #229
Comments
I have created a tracking issue on v8 here: |
Original commit message: [coverage] remove the last continuation range before synthetic return Rather than only removing the continuation range for the last return statement prior to a synthetic return statement, remove the continuation tracking for whatever statement occurs prior to the synthetic return. Bug: v8:10628 Change-Id: Ieb8e393479c9811cf1b9756840bbfdbe7f44a1b8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2280585 Commit-Queue: Benjamin Coe <bencoe@google.com> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Sigurd Schneider <sigurds@chromium.org> Cr-Commit-Position: refs/heads/master@{#68719} Refs: v8/v8@2d5017a PR-URL: #34272 Refs: bcoe/c8#229 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
Original commit message: [coverage] remove the last continuation range before synthetic return Rather than only removing the continuation range for the last return statement prior to a synthetic return statement, remove the continuation tracking for whatever statement occurs prior to the synthetic return. Bug: v8:10628 Change-Id: Ieb8e393479c9811cf1b9756840bbfdbe7f44a1b8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2280585 Commit-Queue: Benjamin Coe <bencoe@google.com> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Sigurd Schneider <sigurds@chromium.org> Cr-Commit-Position: refs/heads/master@{#68719} Refs: v8/v8@2d5017a PR-URL: nodejs#34272 Refs: bcoe/c8#229 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
Original commit message: [coverage] remove the last continuation range before synthetic return Rather than only removing the continuation range for the last return statement prior to a synthetic return statement, remove the continuation tracking for whatever statement occurs prior to the synthetic return. Bug: v8:10628 Change-Id: Ieb8e393479c9811cf1b9756840bbfdbe7f44a1b8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2280585 Commit-Queue: Benjamin Coe <bencoe@google.com> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Sigurd Schneider <sigurds@chromium.org> Cr-Commit-Position: refs/heads/master@{#68719} Refs: v8/v8@2d5017a PR-URL: #34272 Refs: bcoe/c8#229 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
Original commit message: [coverage] remove the last continuation range before synthetic return Rather than only removing the continuation range for the last return statement prior to a synthetic return statement, remove the continuation tracking for whatever statement occurs prior to the synthetic return. Bug: v8:10628 Change-Id: Ieb8e393479c9811cf1b9756840bbfdbe7f44a1b8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2280585 Commit-Queue: Benjamin Coe <bencoe@google.com> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Sigurd Schneider <sigurds@chromium.org> Cr-Commit-Position: refs/heads/master@{#68719} Refs: v8/v8@2d5017a PR-URL: #34272 Refs: bcoe/c8#229 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
Original commit message: [coverage] remove the last continuation range before synthetic return Rather than only removing the continuation range for the last return statement prior to a synthetic return statement, remove the continuation tracking for whatever statement occurs prior to the synthetic return. Bug: v8:10628 Change-Id: Ieb8e393479c9811cf1b9756840bbfdbe7f44a1b8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2280585 Commit-Queue: Benjamin Coe <bencoe@google.com> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Sigurd Schneider <sigurds@chromium.org> Cr-Commit-Position: refs/heads/master@{#68719} Refs: v8/v8@2d5017a PR-URL: #34272 Refs: bcoe/c8#229 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
See bcoe/c8#229 for possible root cause?
I'm not sure if it's related, but I think I hit this? I happened to be on c8 v7.4.0 when I encountered the failure in CI, but it reproduces in v7.5.0 when run on node v12.20.1. The tests pass, it's just the mysterious coverage gap on an async function that fails in node v12. v14 is fine. dendrochronologist/cli@edd0aaf "fixes" it by ignoring the missed line. Not ideal, long-term. However, if I avoid using the diff --git a/src/api.ts b/src/api.ts
index 99472c5..69c22ef 100644
--- a/src/api.ts
+++ b/src/api.ts
@@ -9,7 +9,7 @@ interface RunOptions extends Partial<ParsedConfig> {
logger?: MinimalLogger;
}
-export async function run({
+export function run({
logger = processLogger(),
...options
}: RunOptions): Promise<Node> {
@@ -22,8 +22,5 @@ export async function run({
const arb = new Arborist({
path: cwd,
});
- const tree = await arb.loadVirtual().catch(() => arb.loadActual());
-
- return tree;
- /* c8 ignore next */
+ return arb.loadVirtual().catch(() => arb.loadActual());
} I validated this locally with
|
To be clear, the node v14 I was passing with is v14.15.4. Which tracks, given the release of the linked back-porting. I have literally no idea if it could (or should?) be back-ported to v12, though it seems like a good candidate if someone has bandwidth? |
@evocateur there are some v8 bug fixes that have landed in v14/v15, that I don't think got backported to v12 unfortunately -- I'm pretty sure that v12 might be closed to extension at this point unfortunately. |
@bcoe Perfectly fair! Especially considering it's going into maintenance mode in like, 2 months? So I'll probably drop v12 before I even finish this wee babby of a tool, lol. |
Just ran into this one as well. Rough one to debug. Any update regarding a fix? |
I'm encountering something similar. My I'm using 5 UpdateNoticed that if you remove the |
@xolott would you be able to provide a minimal breaking example, this would help in investigating the underlying cause. |
@bcoe I have run into a similar issue as reported by @xolott, where the generated output is showing the finally block as uncovered. If you are still interested in troubleshooting, here is a minimum example repro EDIT: Just noticed that if you change the handler to finish without returning then the finally block is marked as covered: |
Observed Behavior
The following code:
Ends up having the following coverage output:
This indicates that the following characters were tracked as an uncovered block:
Expected behavior
Coverage should be 100% in the above example.
The text was updated successfully, but these errors were encountered: