From 650725d71e909089e5087169d8d694e3f4076e4c Mon Sep 17 00:00:00 2001 From: zgfzgf <1901989065@qq.com> Date: Sat, 26 Sep 2020 17:30:58 +0800 Subject: [PATCH] add printf --- api/test/window_post.go | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/api/test/window_post.go b/api/test/window_post.go index 683489a91..958c91816 100644 --- a/api/test/window_post.go +++ b/api/test/window_post.go @@ -153,18 +153,16 @@ func TestWindowPost(t *testing.T, b APIBuilder, blocktime time.Duration, nSector require.NoError(t, err) fmt.Printf("Running one proving period\n") + fmt.Printf("End for head.Height > %d\n", di.PeriodStart+di.WPoStProvingPeriod+2) for { head, err := client.ChainHead(ctx) require.NoError(t, err) if head.Height() > di.PeriodStart+(di.WPoStProvingPeriod)+2 { + fmt.Printf("Now head.Height = %d\n", head.Height()) break } - - if head.Height()%100 == 0 { - fmt.Printf("@%d\n", head.Height()) - } build.Clock.Sleep(blocktime) } @@ -186,7 +184,6 @@ func TestWindowPost(t *testing.T, b APIBuilder, blocktime time.Duration, nSector require.Greater(t, len(parts), 0) secs := parts[0].AllSectors - require.NoError(t, err) n, err := secs.Count() require.NoError(t, err) require.Equal(t, uint64(2), n) @@ -210,7 +207,6 @@ func TestWindowPost(t *testing.T, b APIBuilder, blocktime time.Duration, nSector require.Greater(t, len(parts), 0) secs := parts[0].AllSectors - require.NoError(t, err) n, err := secs.Count() require.NoError(t, err) require.Equal(t, uint64(2), n) @@ -236,18 +232,17 @@ func TestWindowPost(t *testing.T, b APIBuilder, blocktime time.Duration, nSector require.NoError(t, err) fmt.Printf("Go through another PP, wait for sectors to become faulty\n") + fmt.Printf("End for head.Height > %d\n", di.PeriodStart+di.WPoStProvingPeriod+2) for { head, err := client.ChainHead(ctx) require.NoError(t, err) if head.Height() > di.PeriodStart+(di.WPoStProvingPeriod)+2 { + fmt.Printf("Now head.Height = %d\n", head.Height()) break } - if head.Height()%100 == 0 { - fmt.Printf("@%d\n", head.Height()) - } build.Clock.Sleep(blocktime) } @@ -267,17 +262,17 @@ func TestWindowPost(t *testing.T, b APIBuilder, blocktime time.Duration, nSector di, err = client.StateMinerProvingDeadline(ctx, maddr, types.EmptyTSK) require.NoError(t, err) + fmt.Printf("End for head.Height > %d\n", di.PeriodStart+di.WPoStProvingPeriod+2) + for { head, err := client.ChainHead(ctx) require.NoError(t, err) if head.Height() > di.PeriodStart+di.WPoStProvingPeriod+2 { + fmt.Printf("Now head.Height = %d\n", head.Height()) break } - if head.Height()%100 == 0 { - fmt.Printf("@%d\n", head.Height()) - } build.Clock.Sleep(blocktime) } @@ -300,12 +295,14 @@ func TestWindowPost(t *testing.T, b APIBuilder, blocktime time.Duration, nSector require.NoError(t, err) waitUntil := head.Height() + 10 + fmt.Printf("End for head.Height > %d\n", waitUntil) for { head, err := client.ChainHead(ctx) require.NoError(t, err) if head.Height() > waitUntil { + fmt.Printf("Now head.Height = %d\n", head.Height()) break } }