From 6490ce4d48af37ed7805d093c976282d452b6863 Mon Sep 17 00:00:00 2001 From: Chris Schinnerl Date: Mon, 16 Dec 2024 10:26:55 +0100 Subject: [PATCH] fix TestGouging --- internal/test/e2e/gouging_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/test/e2e/gouging_test.go b/internal/test/e2e/gouging_test.go index 440879972..dc52a39f7 100644 --- a/internal/test/e2e/gouging_test.go +++ b/internal/test/e2e/gouging_test.go @@ -93,14 +93,14 @@ func TestGouging(t *testing.T) { if err := h.UpdateSettings(settings); err != nil { t.Fatal(err) } - } - // make sure the price table expires so the worker is forced to fetch it - // again, this is necessary for the host to be considered price gouging - time.Sleep(defaultHostSettings.PriceTableValidity) + // scan the host + tt.OKAll(cluster.Bus.ScanHost(context.Background(), h.PublicKey(), time.Second)) + } + time.Sleep(testWorkerCfg().CacheExpiry) // wait for cache to refresh - // download the data - should still work - tt.OKAll(w.DownloadObject(context.Background(), io.Discard, testBucket, path, api.DownloadObjectOptions{})) + // download the data - won't work since the hosts are not usable anymore + tt.FailAll(w.DownloadObject(context.Background(), io.Discard, testBucket, path, api.DownloadObjectOptions{})) // try optimising gouging settings resp, err := cluster.Autopilot.EvaluateConfig(context.Background(), test.AutopilotConfig, gs, test.RedundancySettings)