Merge pull request #10572 from filecoin-project/fix/itests-no-mineblk-terr
fix: itests: Don't call t.Error in MineBlocks goroutine
This commit is contained in:
commit
841b7b8730
@ -37,6 +37,8 @@ func TestBatchDealInput(t *testing.T) {
|
||||
|
||||
run := func(piece, deals, expectSectors int) func(t *testing.T) {
|
||||
return func(t *testing.T) {
|
||||
t.Logf("batchtest start")
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
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)
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Logf("batchtest ask set")
|
||||
|
||||
checkNoPadding := func() {
|
||||
sl, err := miner.SectorsListNonGenesis(ctx)
|
||||
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
|
||||
for i := 0; i < int(maxDealsPerMsg); i++ {
|
||||
<-done
|
||||
}
|
||||
|
||||
t.Logf("batchtest deals published")
|
||||
|
||||
checkNoPadding()
|
||||
|
||||
t.Logf("batchtest no padding")
|
||||
|
||||
sl, err := miner.SectorsListNonGenesis(ctx)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, len(sl), expectSectors)
|
||||
|
||||
t.Logf("batchtest done")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -245,7 +245,8 @@ func (bm *BlockMiner) MineBlocksMustPost(ctx context.Context, blocktime time.Dur
|
||||
case ctx.Err() != nil: // context fired.
|
||||
return
|
||||
default: // log error
|
||||
bm.t.Error(err)
|
||||
bm.t.Logf("MINEBLOCKS-post loop error: %+v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
@ -291,7 +292,8 @@ func (bm *BlockMiner) MineBlocks(ctx context.Context, blocktime time.Duration) {
|
||||
case ctx.Err() != nil: // context fired.
|
||||
return
|
||||
default: // log error
|
||||
bm.t.Error(err)
|
||||
bm.t.Logf("MINEBLOCKS loop error: %+v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
Loading…
Reference in New Issue
Block a user