From aa2e9123c71df68aecb489355de941af96ba049a Mon Sep 17 00:00:00 2001 From: Chris Schinnerl Date: Fri, 30 Aug 2024 11:06:11 +0200 Subject: [PATCH] e2e: better error in TestEphemeralAccountSync --- internal/test/e2e/cluster_test.go | 2 +- internal/test/e2e/gouging_test.go | 49 ------------------------------- 2 files changed, 1 insertion(+), 50 deletions(-) diff --git a/internal/test/e2e/cluster_test.go b/internal/test/e2e/cluster_test.go index 6d47d0590..9a801ce43 100644 --- a/internal/test/e2e/cluster_test.go +++ b/internal/test/e2e/cluster_test.go @@ -1384,7 +1384,7 @@ func TestEphemeralAccountSync(t *testing.T) { if len(accounts) != 1 || accounts[0].ID != acc.ID { t.Fatal("account should exist") } else if accounts[0].CleanShutdown || !accounts[0].RequiresSync { - t.Fatalf("account shouldn't be marked as clean shutdown or not require a sync, got %v", accounts[0]) + t.Fatalf("account shouldn't be marked as clean shutdown or not require a sync, got %v", accounts[0].CleanShutdown, accounts[0].RequiresSync) } // assert account was funded diff --git a/internal/test/e2e/gouging_test.go b/internal/test/e2e/gouging_test.go index 4dc7914ba..851362489 100644 --- a/internal/test/e2e/gouging_test.go +++ b/internal/test/e2e/gouging_test.go @@ -13,7 +13,6 @@ import ( "go.sia.tech/core/types" "go.sia.tech/renterd/api" "go.sia.tech/renterd/internal/test" - "go.uber.org/zap/zapcore" "lukechampine.com/frand" ) @@ -136,54 +135,6 @@ func TestGouging(t *testing.T) { }) } -// TestAccountFunding is a regression tests that verify we can fund an account -// even if the host is considered gouging, this protects us from not being able -// to download from certain critical hosts when we migrate away from them. -func TestAccountFunding(t *testing.T) { - if testing.Short() { - t.SkipNow() - } - - // run without autopilot - opts := clusterOptsDefault - opts.skipRunningAutopilot = true - opts.logger = newTestLoggerCustom(zapcore.ErrorLevel) - - // create a new test cluster - cluster := newTestCluster(t, opts) - defer cluster.Shutdown() - - // convenience variables - b := cluster.Bus - w := cluster.Worker - tt := cluster.tt - - // add a host - hosts := cluster.AddHosts(1) - h, err := b.Host(context.Background(), hosts[0].PublicKey()) - tt.OK(err) - - // scan the host - _, err = w.RHPScan(context.Background(), h.PublicKey, h.NetAddress, 10*time.Second) - tt.OK(err) - - // manually form a contract with the host - cs, _ := b.ConsensusState(context.Background()) - wallet, _ := b.Wallet(context.Background()) - endHeight := cs.BlockHeight + test.AutopilotConfig.Contracts.Period + test.AutopilotConfig.Contracts.RenewWindow - _, err = b.FormContract(context.Background(), wallet.Address, types.Siacoins(1), h.PublicKey, h.NetAddress, types.Siacoins(1), endHeight) - tt.OK(err) - - // update host so it's gouging - settings := hosts[0].settings.Settings() - settings.StoragePrice = types.Siacoins(1) - tt.OK(hosts[0].UpdateSettings(settings)) - - // fund the account again - panic("fund account") - // tt.OK(b.FundAccount(context.Background(), accID, c.HostKey, c.HostIP, c.SiamuxAddr, types.Siacoins(1))) -} - func TestHostMinVersion(t *testing.T) { if testing.Short() { t.SkipNow()