Browse Source

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.
master
Oliver Gugger 3 years ago
parent
commit
3823315820
No known key found for this signature in database
GPG Key ID: 8E4256593F177720
  1. 2
      lntest/harness.go
  2. 2
      lntest/wait/wait.go

2
lntest/harness.go

@ -223,7 +223,7 @@ func (n *NetworkHarness) SetUp(testCase string, lndArgs []string) error {
// Now block until both wallets have fully synced up.
expectedBalance := int64(btcutil.SatoshiPerBitcoin * 10)
balReq := &lnrpc.WalletBalanceRequest{}
balanceTicker := time.NewTicker(time.Millisecond * 50)
balanceTicker := time.NewTicker(time.Millisecond * 200)
defer balanceTicker.Stop()
balanceTimeout := time.After(time.Second * 30)
out:

2
lntest/wait/wait.go

@ -11,7 +11,7 @@ import (
// several running lnd nodes. This function gives callers a way to assert that
// some property is upheld within a particular time frame.
func Predicate(pred func() bool, timeout time.Duration) error {
const pollInterval = 20 * time.Millisecond
const pollInterval = 200 * time.Millisecond
exitTimer := time.After(timeout)
for {

Loading…
Cancel
Save