fix: itests: Don't hang on exit in MineBlocksMustPost

This commit is contained in:
Łukasz Magiera 2022-03-18 10:42:21 +01:00
parent 18987f92ee
commit 42b2adddee

View File

@ -192,7 +192,11 @@ func (bm *BlockMiner) MineBlocksMustPost(ctx context.Context, blocktime time.Dur
InjectNulls: abi.ChainEpoch(nulls + i),
Done: reportSuccessFn,
})
success = <-wait
select {
case success = <-wait:
case <-ctx.Done():
return
}
if !success {
// if we are mining a new null block and it brings us past deadline boundary we need to wait for miner to post
if ts.Height()+1+abi.ChainEpoch(nulls+i) >= dlinfo.Last() {