From a0f2bb07556dc355dec93fd569a4bf8aa1895878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 14 Jan 2020 03:51:14 +0100 Subject: [PATCH] Increase block delay for TestAPIDealFlowReal --- api/test/deals.go | 4 ++-- node/node_test.go | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/api/test/deals.go b/api/test/deals.go index 4d4b2a2a3..4c2fb7439 100644 --- a/api/test/deals.go +++ b/api/test/deals.go @@ -24,7 +24,7 @@ func init() { build.InsecurePoStValidation = true } -func TestDealFlow(t *testing.T, b APIBuilder) { +func TestDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration) { os.Setenv("BELLMAN_NO_GPU", "1") ctx := context.Background() @@ -64,7 +64,7 @@ func TestDealFlow(t *testing.T, b APIBuilder) { go func() { defer close(done) for mine { - time.Sleep(10 * time.Millisecond) + time.Sleep(blocktime) fmt.Println("mining a block now") if err := sn[0].MineOne(ctx); err != nil { t.Error(err) diff --git a/node/node_test.go b/node/node_test.go index 5bc80649b..ea92a92b6 100644 --- a/node/node_test.go +++ b/node/node_test.go @@ -8,6 +8,7 @@ import ( "net/http/httptest" "path/filepath" "testing" + "time" "github.com/filecoin-project/go-address" sectorbuilder "github.com/filecoin-project/go-sectorbuilder" @@ -392,12 +393,12 @@ func TestAPIRPC(t *testing.T) { } func TestAPIDealFlow(t *testing.T) { - test.TestDealFlow(t, mockSbBuilder) + test.TestDealFlow(t, mockSbBuilder, 10 * time.Millisecond) } func TestAPIDealFlowReal(t *testing.T) { if testing.Short() { t.Skip("skipping test in short mode") } - test.TestDealFlow(t, builder) + test.TestDealFlow(t, builder, time.Second) }