Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpctest: integration test harness fixes #2071

Merged
merged 5 commits into from
Dec 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
rpctest: fix formatting
  • Loading branch information
guggero committed Dec 21, 2023
commit 6e7680ad15358d50c9eb911aabd6f58f8840c6ed
15 changes: 9 additions & 6 deletions integration/rpctest/rpc_harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ func (h *Harness) SetUp(createTestChain bool, numMatureOutputs uint32) error {
// Create a test chain with the desired number of mature coinbase
// outputs.
if createTestChain && numMatureOutputs != 0 {
numToGenerate := (uint32(h.ActiveNet.CoinbaseMaturity) +
numMatureOutputs)
coinbaseMaturity := uint32(h.ActiveNet.CoinbaseMaturity)
numToGenerate := coinbaseMaturity + numMatureOutputs
_, err := h.Client.Generate(numToGenerate)
if err != nil {
return err
Expand Down Expand Up @@ -351,15 +351,18 @@ func (h *Harness) connectRPCClient() error {
batchConf.HTTPPostMode = true
for i := 0; i < h.MaxConnRetries; i++ {
fail := false
timeout := time.Duration(i) * h.ConnectionRetryTimeout
if client == nil {
if client, err = rpcclient.New(&rpcConf, h.handlers); err != nil {
time.Sleep(time.Duration(i) * h.ConnectionRetryTimeout)
client, err = rpcclient.New(&rpcConf, h.handlers)
if err != nil {
time.Sleep(timeout)
fail = true
}
}
if batchClient == nil {
if batchClient, err = rpcclient.NewBatch(&batchConf); err != nil {
time.Sleep(time.Duration(i) * h.ConnectionRetryTimeout)
batchClient, err = rpcclient.NewBatch(&batchConf)
if err != nil {
time.Sleep(timeout)
fail = true
}
}
Expand Down