fix: itest: avoid failing the test when we race the miner
I've been seeing quite a few tests failing here, so I'm hoping this will deflake them a bit.
This commit is contained in:
parent
75c279ab97
commit
b852f5e2fd
@ -192,12 +192,15 @@ func (bm *BlockMiner) MineBlocksMustPost(ctx context.Context, blocktime time.Dur
|
|||||||
reportSuccessFn := func(success bool, epoch abi.ChainEpoch, err error) {
|
reportSuccessFn := func(success bool, epoch abi.ChainEpoch, err error) {
|
||||||
// if api shuts down before mining, we may get an error which we should probably just ignore
|
// if api shuts down before mining, we may get an error which we should probably just ignore
|
||||||
// (fixing it will require rewriting most of the mining loop)
|
// (fixing it will require rewriting most of the mining loop)
|
||||||
if err != nil && !strings.Contains(err.Error(), "websocket connection closed") && !api.ErrorIsIn(err, []error{new(jsonrpc.RPCConnectionError)}) {
|
if err != nil && ctx.Err() == nil && !strings.Contains(err.Error(), "websocket connection closed") && !api.ErrorIsIn(err, []error{new(jsonrpc.RPCConnectionError)}) {
|
||||||
require.NoError(bm.t, err)
|
require.NoError(bm.t, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
target = epoch
|
target = epoch
|
||||||
wait <- success
|
select {
|
||||||
|
case wait <- success:
|
||||||
|
case <-ctx.Done():
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var success bool
|
var success bool
|
||||||
|
Loading…
Reference in New Issue
Block a user