Skip to content

Commit

Permalink
fix TestRenterRenew
Browse files Browse the repository at this point in the history
Mining testPeriod blocks causes the test to fail because the renter
will be trying to renew contracts during the download. This also
occurs for testPeriod/2, but the test does not fail because of the
API polling immediately after the mining: the poll ends when the
contract ID changes, but when testPeriod blocks are mined, the
contract ID will have changed twice, not once.
  • Loading branch information
lukechampine committed Mar 3, 2017
1 parent 2ab7650 commit 517b4cc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/renterhost_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,8 @@ func TestRenterRenew(t *testing.T) {
contractID := rc.Contracts[0].ID

// Mine enough blocks to enter the renewal window.
for i := 0; i < testPeriod; i++ {
testWindow := testPeriod / 2
for i := 0; i < testWindow+1; i++ {
st.miner.AddBlock()
}
// Wait for the contract to be renewed.
Expand Down

0 comments on commit 517b4cc

Please sign in to comment.