Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Suggestion: Restart TestRPC (optionally) after/before tests #412

Closed
1 task
XertroV opened this issue May 24, 2017 · 2 comments
Closed
1 task

Suggestion: Restart TestRPC (optionally) after/before tests #412

XertroV opened this issue May 24, 2017 · 2 comments

Comments

@XertroV
Copy link

XertroV commented May 24, 2017

Issue

This is a suggestion, and I'm posting this for the purpose of discussion.

In an effort to make truffle as resilient, deterministic, and newb friendly as possible, I'd suggest optionally restarting/starting testrpc after or before tests.

The justification for this is a non-deterministic issue that can arise from repeat testing:

When running a test suite that accidentally throws or otherwise expends the balance of an account, running that test again (once corrected to avoid throwing) results in trying to use an account with zero balance. The test fails with the following error:

Error: Error: sender doesn't have enough funds to send tx. The upfront cost is: 471238800000000000 and the senders account only has: 0

Steps to Reproduce

  • Run a test that throws (due to bad parameters)
  • Run the test again without those bad params.
  • Test fails.

Expected Behavior

It would be nice if the 'snapshotting' feature of testrpc extended to accounts.

Actual Results

Test fails.

Environment

  • Operating System: macos 10.12
  • Truffle version: v3.3.2
  • Ethereum client: testrpc
  • node version: 6.9.2
  • npm version: 3.10.9

Addendum

Can provide more details or an example if necessary.

@tcoulter
Copy link
Contributor

Thanks for the issue! We'll be tracking this in issue #490. Let us know if you have any feedback.

@XertroV
Copy link
Author

XertroV commented Jul 11, 2017

Sounds good, thanks for the update.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants