Increase block delay for TestAPIDealFlowReal
This commit is contained in:
parent
9fded49470
commit
a0f2bb0755
@ -24,7 +24,7 @@ func init() {
|
|||||||
build.InsecurePoStValidation = true
|
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")
|
os.Setenv("BELLMAN_NO_GPU", "1")
|
||||||
|
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
@ -64,7 +64,7 @@ func TestDealFlow(t *testing.T, b APIBuilder) {
|
|||||||
go func() {
|
go func() {
|
||||||
defer close(done)
|
defer close(done)
|
||||||
for mine {
|
for mine {
|
||||||
time.Sleep(10 * time.Millisecond)
|
time.Sleep(blocktime)
|
||||||
fmt.Println("mining a block now")
|
fmt.Println("mining a block now")
|
||||||
if err := sn[0].MineOne(ctx); err != nil {
|
if err := sn[0].MineOne(ctx); err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
|
@ -8,6 +8,7 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-address"
|
"github.com/filecoin-project/go-address"
|
||||||
sectorbuilder "github.com/filecoin-project/go-sectorbuilder"
|
sectorbuilder "github.com/filecoin-project/go-sectorbuilder"
|
||||||
@ -392,12 +393,12 @@ func TestAPIRPC(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestAPIDealFlow(t *testing.T) {
|
func TestAPIDealFlow(t *testing.T) {
|
||||||
test.TestDealFlow(t, mockSbBuilder)
|
test.TestDealFlow(t, mockSbBuilder, 10 * time.Millisecond)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAPIDealFlowReal(t *testing.T) {
|
func TestAPIDealFlowReal(t *testing.T) {
|
||||||
if testing.Short() {
|
if testing.Short() {
|
||||||
t.Skip("skipping test in short mode")
|
t.Skip("skipping test in short mode")
|
||||||
}
|
}
|
||||||
test.TestDealFlow(t, builder)
|
test.TestDealFlow(t, builder, time.Second)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user