question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

embark tests are slooooow

See original GitHub issue

Bug 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):

screen shot 2018-11-15 at 12 26 11 pm

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)

screen shot 2018-11-15 at 12 34 46 pm

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:closed
  • Created 5 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
jrainvillecommented, Nov 20, 2018

Follow up: I just discovered that it’s Ganache’s provider that is super slow.

This is our current code:

const sim = require('ganache-cli');
self.provider = sim.provider(self.config.contractsConfig.deployment);

When changing it to use Ganache as a server, it’s way faster:

this.sim = require('ganache-cli').server();

this.sim.listen(port, host);

this.web3Endpoint = utils.buildUrl(protocol, host, port);
this.provider = new this.web3.providers.HttpProvider(this.web3Endpoint);

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.

0reactions
jrainvillecommented, Nov 20, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Science Behind the Embark Dog Age Test
We explain how the Embark Dog Age Test uses DNA methylation, a form of epigenetics, to calculate a dog's calendar age.
Read more >
Embark is so slow… these teaser emails!!!! I'm impatient - Reddit
It's interesting — my friend who had her dog tested had a much slower response than I did, just a few weeks after...
Read more >
Embark review: A thorough, well-rounded dog DNA test
The Embark DNA test sheds light on your pet's background and health in a straightforward, comprehensive manner.
Read more >
Pet Testing Reviews for Embark
114 Embark reviews, price comparisons and special offers. They're ranked 1 out of 22 for Pet Testing and rated 5 out of 5...
Read more >
At Embark Veterinary, pandemic pet ... - The Business Journals
One might think sales of the Boston company's $199 dog DNA testing kit might at least slow down a bit as a result...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found