debug batch deal test a bit more

This commit is contained in:
Łukasz Magiera 2023-03-27 15:34:59 +02:00
parent aebe3d4cf7
commit 6012e65319
2 changed files with 14 additions and 1 deletions

View File

@ -37,6 +37,8 @@ func TestBatchDealInput(t *testing.T) {
run := func(piece, deals, expectSectors int) func(t *testing.T) { run := func(piece, deals, expectSectors int) func(t *testing.T) {
return func(t *testing.T) { return func(t *testing.T) {
t.Logf("batchtest start")
ctx := context.Background() ctx := context.Background()
publishPeriod := 10 * time.Second publishPeriod := 10 * time.Second
@ -73,6 +75,8 @@ func TestBatchDealInput(t *testing.T) {
err := miner.MarketSetAsk(ctx, big.Zero(), big.Zero(), 200, 128, 32<<30) err := miner.MarketSetAsk(ctx, big.Zero(), big.Zero(), 200, 128, 32<<30)
require.NoError(t, err) require.NoError(t, err)
t.Logf("batchtest ask set")
checkNoPadding := func() { checkNoPadding := func() {
sl, err := miner.SectorsListNonGenesis(ctx) sl, err := miner.SectorsListNonGenesis(ctx)
require.NoError(t, err) require.NoError(t, err)
@ -118,16 +122,24 @@ func TestBatchDealInput(t *testing.T) {
}() }()
} }
t.Logf("batchtest deals started")
// Wait for maxDealsPerMsg of the deals to be published // Wait for maxDealsPerMsg of the deals to be published
for i := 0; i < int(maxDealsPerMsg); i++ { for i := 0; i < int(maxDealsPerMsg); i++ {
<-done <-done
} }
t.Logf("batchtest deals published")
checkNoPadding() checkNoPadding()
t.Logf("batchtest no padding")
sl, err := miner.SectorsListNonGenesis(ctx) sl, err := miner.SectorsListNonGenesis(ctx)
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, len(sl), expectSectors) require.Equal(t, len(sl), expectSectors)
t.Logf("batchtest done")
} }
} }

View File

@ -245,7 +245,8 @@ func (bm *BlockMiner) MineBlocksMustPost(ctx context.Context, blocktime time.Dur
case ctx.Err() != nil: // context fired. case ctx.Err() != nil: // context fired.
return return
default: // log error default: // log error
bm.t.Error(err) bm.t.Logf("MINEBLOCKS-post loop error: %+v", err)
return
} }
} }
}() }()