OpenZeppelin / openzeppelin-test-environment

[Not actively maintained] One-line setup for blazing-fast smart contracts tests
https://docs.openzeppelin.com/test-environment
MIT License
90 stars 39 forks source link

Open handles with Jest configuration #168

Open 4rokis opened 3 years ago

4rokis commented 3 years ago

I am trying to set up a typescript with jest configuration. However, as soon as i have switched to jest i am getting this error. My understanding is that i should clean something up. Do you have any idea what? Happens on pure JS as well.

Repository https://github.com/S4n60w3n/cryptolette

Jest has detected the following 2 open handles potentially keeping Jest from exiting:

  ●  PROCESSWRAP

    > 1 | import { accounts, contract } from '@openzeppelin/test-environment';
        | ^
      2 | import { BN } from '@openzeppelin/test-helpers'
      3 |
      4 | const MyContract = contract.fromArtifact('Cryptolette');

      at Object.default_1 [as default] (node_modules/@openzeppelin/test-environment/src/setup-ganache.ts:35:20)
      at node_modules/@openzeppelin/test-environment/src/test-provider.ts:21:37
      at run (node_modules/p-queue/dist/index.js:157:104)
      at PQueue._tryToStartAnother (node_modules/p-queue/dist/index.js:105:17)
      at node_modules/p-queue/dist/index.js:171:18
      at PQueue.add (node_modules/p-queue/dist/index.js:152:16)
      at new TestProvider (node_modules/@openzeppelin/test-environment/src/test-provider.ts:19:16)
      at Object.<anonymous> (node_modules/@openzeppelin/test-environment/src/setup-provider.ts:6:18)
      at Object.<anonymous> (node_modules/@openzeppelin/test-environment/src/helpers.ts:6:1)
      at Object.<anonymous> (node_modules/@openzeppelin/test-environment/src/index.ts:1:1)
      at Object.<anonymous> (test/cryptolette.test.ts:1:1)
      at TestScheduler.scheduleTests (node_modules/@jest/core/build/TestScheduler.js:333:13)
      at runJest (node_modules/@jest/core/build/runJest.js:387:19)
      at _run10000 (node_modules/@jest/core/build/cli/index.js:408:7)
      at runCLI (node_modules/@jest/core/build/cli/index.js:261:3)

  ●  PIPEWRAP

    > 1 | import { accounts, contract } from '@openzeppelin/test-environment';
        | ^
      2 | import { BN } from '@openzeppelin/test-helpers'
      3 |
      4 | const MyContract = contract.fromArtifact('Cryptolette');

          at Array.reduce (<anonymous>)
      at Object.default_1 [as default] (node_modules/@openzeppelin/test-environment/src/setup-ganache.ts:35:20)
      at node_modules/@openzeppelin/test-environment/src/test-provider.ts:21:37
      at run (node_modules/p-queue/dist/index.js:157:104)
      at PQueue._tryToStartAnother (node_modules/p-queue/dist/index.js:105:17)
      at node_modules/p-queue/dist/index.js:171:18
      at PQueue.add (node_modules/p-queue/dist/index.js:152:16)
      at new TestProvider (node_modules/@openzeppelin/test-environment/src/test-provider.ts:19:16)
      at Object.<anonymous> (node_modules/@openzeppelin/test-environment/src/setup-provider.ts:6:18)
      at Object.<anonymous> (node_modules/@openzeppelin/test-environment/src/helpers.ts:6:1)
      at Object.<anonymous> (node_modules/@openzeppelin/test-environment/src/index.ts:1:1)
      at Object.<anonymous> (test/cryptolette.test.ts:1:1)
      at TestScheduler.scheduleTests (node_modules/@jest/core/build/TestScheduler.js:333:13)
      at runJest (node_modules/@jest/core/build/runJest.js:387:19)
      at _run10000 (node_modules/@jest/core/build/cli/index.js:408:7)
      at runCLI (node_modules/@jest/core/build/cli/index.js:261:3)
FrozenKiwi commented 3 years ago

I'm having the same issue. For local tests it is a superficial issue but in CI (GitHub Actions) it appears to be blocking my tests from completing.

There is something here to disconnect the server: https://github.com/OpenZeppelin/openzeppelin-test-environment/blob/08c0b342f6542d67fde71219a1ecb4c696f73652/src/ganache-server.ts#L33 I just can't figure out how to trigger it

FrozenKiwi commented 3 years ago

For CI, I added --forceExit to make sure the tests complete.

Nilotaviano commented 3 years ago

I'm having the same issue

yujonglee commented 3 years ago

I'm having the same issue. Anyone has a solution?