Ganache-cli: Residual test state shared between test files when working with [email protected]

Created on 27 Nov 2018  路  7Comments  路  Source: trufflesuite/ganache-cli

Expected Behavior

The before, beforeEachand tests in a single test file should not be returning different results when querying a contract property instance that hasn't been changed in that test file.

Current Behavior

1st test file runs
beforeEach - instantiates a new token CLNY = Token.new()=> and sets it on ColonyNetwork.deployed()

2nd test file runs
before - get ColonyNetwork.deployed() => get CLNY - returns a new address
beforeEach - get ColonyNetwork.deployed() => get CLNY- returns a new address
helper function - get ColonyNetwork.deployed() => get CLNY - returns the address from 1st test above
The before and beforeEach of 2) are inventing some unknown token instance

Steps to Reproduce (for bugs)

I haven't had time to isolate this into a minimum working example, but using our test suite at Colony you can just run colony-network-auction.js and colony-network-mining.js test files and observe this problem in that the MetaColony.token property differs in colony-network-mining.js between the before and tests.

Your Environment

needs validation priority-medium

Most helpful comment

This is fine for us too. Thanks for addressing @nicholasjpaterno !

All 7 comments

Thanks @elenadimitrova. Looking into this now!

@elenadimitrova, Were you able to get a minimal test case for this issue? We're having a hard time pinpointing the issue ourselves.

I am having the same issue as well @davidmurdoch, I can run individual test perfectly but not in full test suite.

@elenadimitrova, thanks for reporting this and @0xAshish for the additional info!

Can you try the latest ganache-cli@beta (v6.2.4-beta.1) and let us know if you're still experiencing this issue during your unit tests?

@nicholasjpaterno Thanks that worked awesomely. 馃槑

@0xAshish Awesome, very glad to hear that!

I'm going to close this for now, @elenadimitrova if you're still experiencing this issue - please feel free to reopen!

This is fine for us too. Thanks for addressing @nicholasjpaterno !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leopoldjoy picture leopoldjoy  路  3Comments

dekz picture dekz  路  5Comments

axic picture axic  路  5Comments

kumavis picture kumavis  路  3Comments

dwalintukan picture dwalintukan  路  6Comments