Commit 584e4497 authored by Christopher Schinnerl's avatar Christopher Schinnerl

add retry to TestUploadedBytesReporting

parent bfa6f540
......@@ -1674,14 +1674,23 @@ func TestUploadedBytesReporting(t *testing.T) {
}
// Upload progress should be 100% and redundancy should reach 2
if len(rf.Files) != 1 {
t.Fatal("Expected 1 file but got", len(rf.Files))
}
if rf.Files[0].UploadProgress < 100 {
t.Fatal("Expected UploadProgress to be 100 but was", rf.Files[0].UploadProgress)
}
if rf.Files[0].Redundancy != 2 {
t.Fatal("Expected Redundancy to be 2 but was", rf.Files[0].Redundancy)
err = build.Retry(100, 100*time.Millisecond, func() error {
if err := st.getAPI("/renter/files", &rf); err != nil {
return err
}
if len(rf.Files) != 1 {
return fmt.Errorf("Expected 1 file but got %v", len(rf.Files))
}
if rf.Files[0].UploadProgress < 100 {
return fmt.Errorf("Expected UploadProgress to be 100 but was %v", rf.Files[0].UploadProgress)
}
if rf.Files[0].Redundancy != 2 {
return fmt.Errorf("Expected Redundancy to be 2 but was %v", rf.Files[0].Redundancy)
}
return nil
})
if err != nil {
t.Fatal(err)
}
// When the file is fully redundantly uploaded, UploadedBytes should
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment