Using ganache-cli 6.8.1-beta.0. Also happens on ganache-cli 6.8.0-istanbul.0.
The error is
Invalid JSON RPC response: "Error: connect ETIMEDOUT 127.0.0.1:8545\n at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)"
The truffle mocha tests run fine for the first 10 minutes or so but then the tests start to take longer and fail sporadically, sometimes mid-test and sometimes in beforeEach.
The early tests take 44-500ms.

The tests right before the first failure start to take longer, but less than 500

ms
After the first connection reset, the tests spike above 9000ms, and I have seen them as high as 27000ms.

The increase explodes slowly, and did not happen in prior versions, though we were upgrading from ganache-cli 6.1.0.
I forgot to include a screenshot of the error

I have also seen this error twice, though I think it's unrelated because it doesn't happen every time.
TypeError: this.removeListener is not a function
at Object.receipt (~/work/true-currencies/node_modules/truffle/build/webpack:/packages/contract/lib/handlers.js:138:1)
at Function.start (~/work/true-currencies/node_modules/truffle/build/webpack:/packages/contract/lib/override.js:53:1)
New record, 229986ms

The failures do not coincide with a dramatic increase in memory, but do coincide with a dramatic drop in CPU utilization from the ganache process.
We are working around by running only one file at a time. restarting truffle and ganache for each.
The aforementioned workaround worked without restarting ganache, so I think this is a truffle issue.
@wjmelements Thanks for taking the time to create and update this issue! I'm going to cc @CruzMolina and @eggplantzzz for some extra eyes from the truffle side. Thanks again!
Hey @wjmelements , which version of truffle and node are you using?
@CruzMolina 5.1.2
I see ganache and truffle both run in node but I don't see node among the dependencies. My globally-installed node version is v10.14.1.
Thanks @wjmelements !
Can you provide a repo for reproduction/debugging purposes? If not, can you try running your tests with [email protected] and see if the problem is resolved?
https://github.com/trusttoken/true-currencies/commit/5eefff87b678b97985fd150f642853d650199933
npm test at this commit fails for the reason cited in this issue with the
output screenshotted. Note the repo setup instructions in the readme,
particularly the git submodule + npm install.
I believe it also failed for 5.0.44, which is the truffle version at that
commit.
On Wed, Dec 11, 2019 at 7:38 PM Cruz Molina notifications@github.com
wrote:
Thanks @wjmelements https://github.com/wjmelements ! Can you provide a
repo for reproduction/debugging purposes? If not, can you try running your
tests against [email protected] and see if the problem is resolved?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/trufflesuite/ganache-cli/issues/703?email_source=notifications&email_token=AAGDGVJMVA3IQFDDLY2YUX3QYGW2LA5CNFSM4JWHVUE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGVLMGQ#issuecomment-564835866,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAGDGVPBSUTKLL2WWPJJD7TQYGW2LANCNFSM4JWHVUEQ
.
Thanks! If it's the same issue I think it is, 5.0.44 should fail, but not 5.0.43. Will check this out and get back to you.
Sweet. All tests passed using 5.0.43 on that commit.
It's very likely that this issue has been resolved by trufflesuite/truffle#2663.
Yup, ran into the same issues as you did @wjmelements when running the tests against 5.0.44.
There should be a new truffle release by the end of this week that solves this, meanwhile 5.0.43 should be good to pin to 🤞.
Thanks, will do!
On Wed, Dec 11, 2019 at 9:24 PM Cruz Molina notifications@github.com
wrote:
Yup, ran into the same issues as you did @wjmelements
https://github.com/wjmelements when running the tests against 5.0.44.There should be a new truffle release by the end of this week that solves
this, meanwhile 5.0.43 should be good to pin to 🤞.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/trufflesuite/ganache-cli/issues/703?email_source=notifications&email_token=AAGDGVLTKTCZBFMASVY7O2LQYHDH7A5CNFSM4JWHVUE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGVQBGI#issuecomment-564854937,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAGDGVOQ3ZSUGTHZBH4ONRTQYHDH7ANCNFSM4JWHVUEQ
.
Closing as I believe this has been resolved, but happy to reopen if this week's release or pinning to 5.0.43 does not in fact resolve this issue.
Most helpful comment
Yup, ran into the same issues as you did @wjmelements when running the tests against 5.0.44.
There should be a new truffle release by the end of this week that solves this, meanwhile 5.0.43 should be good to pin to 🤞.