Skip to content

Finalizer should not have run #932

Closed

Description

@mhdawson

Even though the tests reports as passed, I'm seeing this in the output.

Running test 'object/finalizer'
(node:1257166) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: function should not have been called
at mustNotCall (/home/midawson/newpull/land/node-addon-api/test/common/index.js:74:12)
(Use node --trace-warnings ... to show where the warning was created)
(node:1257166) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1257166) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Activity

  1. mhdawson commented on Mar 15, 2021

    @mhdawson
    MemberAuthor

    Turns out that it was because of an PR I'd just landed: #928

    I reverted that PR, but leaving it open so we don't forget to figure out the issue and get the PR re-landed.

  2. changed the title [-]Finalizer should not have run - Nodejs 14.x [/-] [+]Finalizer should not have run[/+] on Mar 15, 2021
  3. added a commit that references this issue on Mar 17, 2021
    96104f9
  4. JoseExposito commented on Mar 17, 2021

    @JoseExposito
    Contributor

    Fixed for this particular case on #937. The problems was that, because of a side effect cause by a new test, common.mustNotCall() was invoked.

    Even though it is fixed, the tests finish with OK status, so it is easy to overlook the issue.
    Maybe, a proper fix is adding an optional parameter to the common.mustNotCall() signature indicating if the execution of the tests should end with status -1.

  5. mhdawson commented on Mar 22, 2021

    @mhdawson
    MemberAuthor

    @JoseExposito thanks for working on the fix.

  6. mhdawson commented on Mar 22, 2021

    @mhdawson
    MemberAuthor

    Closing as the new PR has landed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions