Truffle: Client connection failure/timeout after initially being successful while running tests

Created on 26 Oct 2020  路  6Comments  路  Source: trufflesuite/truffle

  • [ ] I've asked for help in the Truffle Gitter before filing this issue.

Issue

After some tests pass successfully, the rest start failing with connection timeouts/failures.

Steps to Reproduce

Really hard to reproduce, but seems to happen after the tests have been running for some time, and especially when trying to deploy some rather big contracts (consuming ~50 million gas).

Expected Behavior

Tests should pass (no connection timeout).

Actual Results

After the first couple of tests pass successfully, the rest start failing with either

Could not connect to your Ethereum client with the following parameters:
    - host       > 127.0.0.1
    - port       > 8555
    - network_id > *
Please check that your Ethereum client:
    - is running
    - is accepting RPC connections (i.e., "--rpc" option is used in geth)
    - is accessible over the network
    - is properly configured in your Truffle configuration file (truffle-config.js)

or

Error: Timeout of 120000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

After looking at the output on ganache-cli, it looks like it is being bombarded by thousands of eth_getBlockByNumber calls after sending a transaction, especially if the transaction consumes a lot of gas. I'm not sure, but this could possibly be related to https://github.com/trufflesuite/truffle/issues/3464 and/or https://github.com/trufflesuite/truffle/issues/3468.

Note: Downgrading to truffle 5.1.49 seems to resolve the problem.

Environment

  • Operating System:
  • Ethereum client:
  • Truffle version (truffle version): 5.1.50
  • node version (node --version): 10.16.3
  • npm version (npm --version): 6.10.2
bug needs investigated needs reproduced priority3 馃敡

All 6 comments

Hm, well #3464 just got fixed and will get released tomorrow, so if that's the cause, then you should be good.

But I suspect it's not so easy. We'll have to look into this.

Thanks for reporting!

Oh by the way - it'd be super helpful if you could provide a repo for reproduction steps!

Thanks @gnidan ! I will give the new release a try and report back. Unfortunately, I cannot provide the code I used to produce this problem, but if it is still happening on the latest release, I will look at making a dedicated example in a public repo for reproducing it.

@gnidan Sadly, after trying truffle 5.1.51 the problem persists. I have created this repo that reproduces the problem for me locally: https://github.com/rynobey/test-failure-example - please let me know if it does not successfully reproduce.

Thanks for the reproduction repo @rynobey! We'll look into this and hopefully get you a resolution soon.

Same problem (the first error message).
It works well with Truffle 5.1.49, but not with Truffle versions 5.1.50,.5.1.51 and 5.1.52.

For information, I use Ganache CLI v6.12.1 (ganache-core: 2.13.1)

The problem happens when I run a full: truffle test
But it doesn't happen if I test only the file where the error occurs.
Hope this will help.

Was this page helpful?
0 / 5 - 0 ratings