Skip to content

Commit

Permalink
e2e: extend TestGouging
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Feb 29, 2024
1 parent ec4329d commit 59f11ad
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions internal/test/e2e/gouging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,19 @@ func TestGouging(t *testing.T) {
if err := w.DownloadObject(context.Background(), &buffer, api.DefaultBucketName, path, api.DownloadObjectOptions{}); err == nil {
t.Fatal("expected download to fail", err)
}

// try optimising gouging settings
resp, err := cluster.Autopilot.EvaluateConfig(context.Background(), test.AutopilotConfig, test.GougingSettings, test.RedundancySettings)
tt.OK(err)
if resp.Recommendation == nil {
t.Fatal("expected recommendation")
}

// set optimised settings
tt.OK(b.UpdateSetting(context.Background(), api.SettingGouging, resp.Recommendation.GougingSettings))

// renter should recover and be able to upload again

// upload some data - should fail
tt.FailAll(w.UploadObject(context.Background(), bytes.NewReader(data), api.DefaultBucketName, path, api.UploadObjectOptions{}))
}

0 comments on commit 59f11ad

Please sign in to comment.