From a8464a345ba66c90a0fab31aab48b92134308d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 16 Feb 2021 19:19:16 +0100 Subject: [PATCH] Fix tests --- api/test/tape.go | 19 ++----------------- api/test/window_post.go | 2 +- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/api/test/tape.go b/api/test/tape.go index 466bdd829a5..b52162dd65b 100644 --- a/api/test/tape.go +++ b/api/test/tape.go @@ -6,7 +6,6 @@ import ( "testing" "time" - "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/network" "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" @@ -73,23 +72,9 @@ func testTapeFix(t *testing.T, b APIBuilder, blocktime time.Duration, after bool <-done }() - err = miner.PledgeSector(ctx) + sid, err := miner.PledgeSector(ctx) require.NoError(t, err) - // Wait till done. - var sectorNo abi.SectorNumber - for { - s, err := miner.SectorsList(ctx) // Note - the test builder doesn't import genesis sectors into FSM - require.NoError(t, err) - fmt.Printf("Sectors: %d\n", len(s)) - if len(s) == 1 { - sectorNo = s[0] - break - } - - build.Clock.Sleep(100 * time.Millisecond) - } - fmt.Printf("All sectors is fsm\n") // If before, we expect the precommit to fail @@ -101,7 +86,7 @@ func testTapeFix(t *testing.T, b APIBuilder, blocktime time.Duration, after bool } for { - st, err := miner.SectorsStatus(ctx, sectorNo, false) + st, err := miner.SectorsStatus(ctx, sid.Number, false) require.NoError(t, err) if st.State == successState { break diff --git a/api/test/window_post.go b/api/test/window_post.go index 99d48083688..ce42318b2b2 100644 --- a/api/test/window_post.go +++ b/api/test/window_post.go @@ -162,7 +162,7 @@ func pledgeSectors(t *testing.T, ctx context.Context, miner TestStorageNode, n, log.Errorf("WAIT") } log.Errorf("PLEDGING %d", i) - err := miner.PledgeSector(ctx) + _, err := miner.PledgeSector(ctx) require.NoError(t, err) }