0xProject / 0x-monorepo

0x protocol monorepo - includes our smart contracts and many developer tools
Other
1.41k stars 466 forks source link

sol-coverage: Hangs for 100+ tests with many contract calls #2140

Closed PaulRBerg closed 4 years ago

PaulRBerg commented 5 years ago

Expected Behavior

Coverage should be measured as usual.

Current Behavior

The coverage script never ends and sits in idle mode like in the image below:

Screen Shot 2019-09-08 at 19 40 18

It can be closed only via CTRL+C, effectively forcing the bash process to terminate.

Weirdly enough, if I comment out lines 106, 110 and 115 in the "WithdrawFromCompoundingStream.js" file in the "test" folder, sol-coverage doesn't hang anymore. This is why I suspect that the mere complexity of my test suites somehow caused it to hang. Unfortunately I don't have more information beyond this.

Steps to Reproduce (for bugs)

1. git clone git@github.com:sablierhq/sablier.git
2. cd sablier && git checkout bug/sol-coverage-hanging
2. yarn install
3. yarn build
4. cd packages/protocol
5. yarn coverage

I also assembled the sol-coverage-hanging repo which has 200+ tests. Sol-coverage works there, unfortunately, but it might be a good testbed for debugging.

Context

Just trying to measure test coverage. It worked fine prior to having hundreds of tests.

Note: tests themselves are okay (truffle test).

Your Environment

Package Version
ganache-cli 6.6.0
sol-coverage 3.0.10
truffle 5.0.35
PaulRBerg commented 5 years ago

Update

Sometimes, this warning gets printed in between test suites:

(node:95127) MaxListenersExceededWarning: Possible EventEmitter memory leak detected.
101 block listeners added. Use emitter.setMaxListeners() to increase limit
PaulRBerg commented 5 years ago

Update 2

I can confirm this is an issue with sol-coverage or some other 0x tool. I just measured test coverage on the exact same test suites with solidity-coverage and everything worked fine.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been automatically closed because no activity occured in 7 days after being marked as stale. If it's still relevant - feel free to reopen. Thank you for your contributions.