[Ethereum] Truffle test – Timeout during out-of-the-box metacoin.js test

testingtruffle

Been trying to get the standard init tests to work for a couple of hours, but no joy. Would be grateful for any assistance.

Steps taken so far

truffle init

Fine. So far, so good.

truffle compile 

Still OK.

truffle migrate

Success.

truffle test

Problems. Seem to have tried everything.

  Contract: MetaCoin
    1) "before all" hook: prepare suite


  0 passing (2m)
  1 failing

  1) Contract: MetaCoin "before all" hook: prepare suite:
     Error: timeout of 120000ms exceeded. Ensure the done() callback is being called in this test.

This seems like it could be a Mocha issue, but the metacoin.js code is off-the-shelf source from Consensys…

Many thanks in advance.

Best Answer

Main author of Truffle here. It's likely related to how fast your Ethereum client is processing blocks. Truffle assumes deployment will take no longer than two minutes during tests, but I have heard reports that when deploying to the morden testnet it can often take far longer. If it does, it can cause truffle test to mark the test as failed and throw an error, as you're seeing above.

We have a ticket filed for this very issue: https://github.com/ConsenSys/truffle/issues/261

Cheers!

Related Topic