Skip to content

Semaphore package leaks handles, prevents node from exiting #318

@dcposch

Description

@dcposch

Describe the bug

My Mocha unit tests hang unless I specify --exit to kill the test process after each suite.

It looks like this may be because Semaphore leaks some resources.

To Reproduce

Write any test or script that verifies a Semaphore proof. At the end, add:

const foo = (process as any)._getActiveHandles();
console.log(foo);

You'll see that this includes a bunch of mysterious MessagePort handles.

Expected behavior

Should show exactly two handles, corresponding to stdin/stdout.

Technologies (please complete the following information):

  • Node.js version 20
  • NPM version 9.6.4
  • Solidity version N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    ✔️ Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions