Skip to content

Conversation

@lance
Copy link
Member

@lance lance commented Mar 14, 2018

When a test fails via common.mustNotCall it is sometimes hard to
determine exactly what was called. This modification stores the
caller's file and line number by using the V8 Error API to capture
a stack at the time common.mustNotCall() is called. In the event
of failure, this information is printed.

This change also exposes a new function in test/common, getCallSite()
which accepts a function and returns a String with the file name and
line number for the function.

Ref: #17257

PR-URL: #17257
Reviewed-By: James M Snell [email protected]
Reviewed-By: Michaël Zasso [email protected]
Reviewed-By: Gibson Fahnestock [email protected]
Reviewed-By: Tobias Nießen [email protected]
Reviewed-By: Joyee Cheung [email protected]
Reviewed-By: Sakthipriyan Vairamani [email protected]
Reviewed-By: Khaidi Chu [email protected]

NOTE: This commit also includes common.canCreateSymlink(), for which the documentation has been backported, but not the implementation. If desired, this can be removed - it came along for the ride when cherry-picking.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

When a test fails via `common.mustNotCall` it is sometimes hard to
determine exactly what was called. This modification stores the
caller's file and line number by using the V8 Error API to capture
a stack at the time `common.mustNotCall()` is called. In the event
of failure, this information is printed.

This change also exposes a new function in test/common, `getCallSite()`
which accepts a `function` and returns a `String` with the file name and
line number for the function.

PR-URL: #17257
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
@nodejs-github-bot nodejs-github-bot added test Issues and PRs related to the tests. v6.x labels Mar 14, 2018
@lance
Copy link
Member Author

lance commented Mar 14, 2018

CI: https://ci.nodejs.org/job/node-test-pull-request/13682/

Failures appear unrelated

@gibfahn gibfahn assigned gibfahn and MylesBorins and unassigned gibfahn Mar 15, 2018
MylesBorins pushed a commit that referenced this pull request Mar 20, 2018
When a test fails via `common.mustNotCall` it is sometimes hard to
determine exactly what was called. This modification stores the
caller's file and line number by using the V8 Error API to capture
a stack at the time `common.mustNotCall()` is called. In the event
of failure, this information is printed.

This change also exposes a new function in test/common, `getCallSite()`
which accepts a `function` and returns a `String` with the file name and
line number for the function.

Backport-PR-URL: #19355
PR-URL: #17257
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
@MylesBorins
Copy link
Contributor

landed in 2b0c071

MylesBorins pushed a commit that referenced this pull request Mar 28, 2018
When a test fails via `common.mustNotCall` it is sometimes hard to
determine exactly what was called. This modification stores the
caller's file and line number by using the V8 Error API to capture
a stack at the time `common.mustNotCall()` is called. In the event
of failure, this information is printed.

This change also exposes a new function in test/common, `getCallSite()`
which accepts a `function` and returns a `String` with the file name and
line number for the function.

Backport-PR-URL: #19355
PR-URL: #17257
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
MylesBorins pushed a commit that referenced this pull request Mar 30, 2018
When a test fails via `common.mustNotCall` it is sometimes hard to
determine exactly what was called. This modification stores the
caller's file and line number by using the V8 Error API to capture
a stack at the time `common.mustNotCall()` is called. In the event
of failure, this information is printed.

This change also exposes a new function in test/common, `getCallSite()`
which accepts a `function` and returns a `String` with the file name and
line number for the function.

Backport-PR-URL: #19355
PR-URL: #17257
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants