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

Commit

Permalink
add more logging to WaitForUploadRedundancy
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Jun 28, 2018
1 parent 772fea6 commit a5f0b70
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion siatest/renter.go
Expand Up @@ -270,7 +270,7 @@ func (tn *TestNode) WaitForUploadRedundancy(rf *RemoteFile, redundancy float64)
return errors.New("file is not tracked by renter")
}
// Wait until it reaches the redundancy
return Retry(600, 100*time.Millisecond, func() error {
err := Retry(600, 100*time.Millisecond, func() error {
file, err := tn.FileInfo(rf)
if err != nil {
return errors.AddContext(err, "couldn't retrieve FileInfo")
Expand All @@ -280,6 +280,20 @@ func (tn *TestNode) WaitForUploadRedundancy(rf *RemoteFile, redundancy float64)
}
return nil
})
if err != nil {
rc, err2 := tn.RenterContractsGet()
if err2 != nil {
return errors.Compose(err, err2)
}
goodHosts := 0
for _, contract := range rc.Contracts {
if contract.GoodForUpload {
goodHosts++
}
}
return errors.Compose(err, fmt.Errorf("%v available hosts", goodHosts))
}
return nil
}

// WaitForDecreasingRedundancy waits until the redundancy decreases to a
Expand Down

0 comments on commit a5f0b70

Please sign in to comment.