lntest: go easy on goroutines when polling
In high CPU usage scenarios such as our parallel itests, it seems that some goroutines just don't get any CPU time before our test timeouts expire. By polling 10 times less frequently, we hope to reduce the overall number of goroutines that are spawned because of the RPC requests within the polling code.
This commit is contained in:
parent
4d2a12e552
commit
3823315820
@ -223,7 +223,7 @@ func (n *NetworkHarness) SetUp(testCase string, lndArgs []string) error {
|
|||||||
// Now block until both wallets have fully synced up.
|
// Now block until both wallets have fully synced up.
|
||||||
expectedBalance := int64(btcutil.SatoshiPerBitcoin * 10)
|
expectedBalance := int64(btcutil.SatoshiPerBitcoin * 10)
|
||||||
balReq := &lnrpc.WalletBalanceRequest{}
|
balReq := &lnrpc.WalletBalanceRequest{}
|
||||||
balanceTicker := time.NewTicker(time.Millisecond * 50)
|
balanceTicker := time.NewTicker(time.Millisecond * 200)
|
||||||
defer balanceTicker.Stop()
|
defer balanceTicker.Stop()
|
||||||
balanceTimeout := time.After(time.Second * 30)
|
balanceTimeout := time.After(time.Second * 30)
|
||||||
out:
|
out:
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
// several running lnd nodes. This function gives callers a way to assert that
|
// several running lnd nodes. This function gives callers a way to assert that
|
||||||
// some property is upheld within a particular time frame.
|
// some property is upheld within a particular time frame.
|
||||||
func Predicate(pred func() bool, timeout time.Duration) error {
|
func Predicate(pred func() bool, timeout time.Duration) error {
|
||||||
const pollInterval = 20 * time.Millisecond
|
const pollInterval = 200 * time.Millisecond
|
||||||
|
|
||||||
exitTimer := time.After(timeout)
|
exitTimer := time.After(timeout)
|
||||||
for {
|
for {
|
||||||
|
Loading…
Reference in New Issue
Block a user