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:
commit
a94e47c6be
@ -192,7 +192,11 @@ func (bm *BlockMiner) MineBlocksMustPost(ctx context.Context, blocktime time.Dur
|
|||||||
InjectNulls: abi.ChainEpoch(nulls + i),
|
InjectNulls: abi.ChainEpoch(nulls + i),
|
||||||
Done: reportSuccessFn,
|
Done: reportSuccessFn,
|
||||||
})
|
})
|
||||||
success = <-wait
|
select {
|
||||||
|
case success = <-wait:
|
||||||
|
case <-ctx.Done():
|
||||||
|
return
|
||||||
|
}
|
||||||
if !success {
|
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 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() {
|
if ts.Height()+1+abi.ChainEpoch(nulls+i) >= dlinfo.Last() {
|
||||||
|
Loading…
Reference in New Issue
Block a user