embark tests are slooooow
See original GitHub issueBug Report
Summary
Embark tests are extremely slow. They are up to 10x slower than using mocha & ganache-cli independently of embark.
Here is a screenshot of running tests before converting to embark (using https://github.com/Giveth/liquidpledging commit 41a087d5093746e87e5031f3f93c0c86db7f347d with command npm run test test/NormalOperation.js
):
And here is a screenshot of running tests using the embark framework. Note the tests are essentially the same, the only difference is I’m using embark to start the simulator & execute the tests. I’m still using the same calls & js wrappers as the above screenshot. (using https://github.com/Giveth/liquidpledging/tree/embark commit 9376cfb1e296e67d66d6f6d665f560ecfb3e427e with command embark test test/NormalOperation.js
)
Embark does include the gas reporter. If that is the cause of the slowdown, I would recommend not running the gas reporter by default and enabling it with a flag
Please provide additional information about your system
OS: macOS mojave Embark Version: master commit 21dff441d1440a2cac6eb791e3c921da248f741d Node Version: NPM Version:
Sometimes issues are related to Embark’s installation. Can you provide information on how Embark was installed?
Issue Analytics
- State:
- Created 5 years ago
- Comments:9
Top GitHub Comments
Follow up: I just discovered that it’s Ganache’s provider that is super slow.
This is our current code:
When changing it to use Ganache as a server, it’s way faster:
I’ll open an issue on Ganache’s side to see if they can fix that. But we’ll probably keep it as a server for now as it is indeed way faster.
Here’s the PR with the fix: https://github.com/embark-framework/embark/pull/1108 If you sue it, you will see that it’s still 20 seconds slower than just
npm run test
. That’s because we run the compilation at the start of the tests and don’t have a way to say, “don’t recompile”.We’ll see if we do implement that type of option.