Merge pull request #8345 from filecoin-project/fix/itest-minepost-hang

fix: itests: Don't hang on exit in MineBlocksMustPost
This commit is contained in:
Łukasz Magiera 2022-03-18 11:27:51 +01:00 committed by GitHub
commit a94e47c6be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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() {