From a5f0b70ee9ea0cdbeefe20e24973063c793df04d Mon Sep 17 00:00:00 2001 From: Christopher Schinnerl Date: Wed, 27 Jun 2018 13:08:10 -0400 Subject: [PATCH] add more logging to WaitForUploadRedundancy --- siatest/renter.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/siatest/renter.go b/siatest/renter.go index 0eac98b198..3601ef6d4b 100644 --- a/siatest/renter.go +++ b/siatest/renter.go @@ -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") @@ -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