Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.

Siatest/Renter clean up #3151

Open
3 tasks
MSevey opened this issue Jul 10, 2018 · 2 comments
Open
3 tasks

Siatest/Renter clean up #3151

MSevey opened this issue Jul 10, 2018 · 2 comments

Comments

@MSevey
Copy link
Contributor

MSevey commented Jul 10, 2018

The siatest/renter package looks at a lot of the same information in many of the test. There are already some helper functions that break out some of the duplicate code but I believe there is more opportunity, especially around mining blocks. I think the following could be done to clean up renter_test.go in the siatest/renter package.

  • Go through tests and refactor code where possible. One common task that many tests do is mine blocks for a certain period of time.

  • Improve renewContractsByRenewWindow . The following can be done to improve this function and test package

  1. remove excess tg.Sync() calls in the tests that call this since it is called in this function
  2. make this more generic by referencing the contracts, potentially redo to be able to handle all mining needs for test
  • Improve renewContractsBySpending to confirm that all contracts will be renewed due to spending, not just first contract to meet condition. Also, confirm that threadedContractMaintenance is triggered before function ends so contracts are renewed by the time the function returns. Add warning if percentRemaining is so large that uploading data to deplete funds would take too long. Right now it seems to work fine because it is every only called after contracts have been renewed by the renew window before hand and have very low amounts of RenterFunds.
@MSevey
Copy link
Contributor Author

MSevey commented Jul 11, 2018

Additional potential task to reduce duplicate code and organize the tests would be:

  • Create a TestRenterGroupWithNoRenter test that groups all the tests that create groups without a renter and then adds the renter after.

@MSevey
Copy link
Contributor Author

MSevey commented Jul 12, 2018

  • Look at how contracts are created for the test nodes and make them smaller so it is faster to renew them by spending

huetsch pushed a commit to HyperspaceApp/Sia that referenced this issue Oct 23, 2018
Siatest/Renter Clean up

Closes NebulousLabs#3151

See merge request NebulousLabs/Sia!3182
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant