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:
Łukasz Magiera 2023-03-28 23:57:04 +02:00 committed by GitHub
commit 841b7b8730
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -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")
}
}

View File

@ -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
}
}
}()