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

Node 14 - ganache-core - Error: Callback was already called. #123

Open abcoathup opened 4 years ago

abcoathup commented 4 years ago

OpenZeppelin Test Environment fails on node 14 with ganache-core error: Error: Callback was already called

node --version v14.4.0
npm --version 6.14.5
npx oz --version 2.8.2

To reproduce follow Learn guides tutorial using node 14 (https://docs.openzeppelin.com/learn/writing-automated-tests#writing-unit-tests)

$ npm test

> testenv@1.0.0 test /home/abcoathup/projects/forum/testenv
> mocha --exit --recursive test

  Box

/home/abcoathup/projects/forum/testenv/node_modules/ganache-core/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:358
                callback(err);
                ^
Error: Callback was already called.
    at /home/abcoathup/projects/forum/testenv/node_modules/ganache-core/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:43:36
    at WriteStream.<anonymous> (/home/abcoathup/projects/forum/testenv/node_modules/ganache-core/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:358:17)
    at WriteStream.emit (events.js:315:20)
    at WriteStream.destroy (/home/abcoathup/projects/forum/testenv/node_modules/ganache-core/node_modules/level-ws/level-ws.js:140:8)
    at finish (_stream_writable.js:658:14)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

Reported in the community forum: https://forum.openzeppelin.com/t/testing-with-node-14-ganache-core-errors-with-callback-was-already-called/3068

Workaround is to use an earlier version of node such as node 10 or node 12.

abcoathup commented 4 years ago

Open issue: https://github.com/trufflesuite/ganache-core/issues/568

sc0Vu commented 2 years ago

Install the beta version of ganache-core works for me (from the issue trufflesuite/ganache#568).

npm install ganache-core@beta -E