chainntnfs: re-try miner connection more often

Make sure we wait for the initial connection long enough.
This commit is contained in:
Oliver Gugger 2024-03-15 12:54:33 +01:00
parent 9cd7285439
commit 2cc28baa84
No known key found for this signature in database
GPG Key ID: 8E4256593F177720

View File

@ -181,6 +181,14 @@ func NewMiner(t *testing.T, netParams *chaincfg.Params, extraArgs []string,
require.NoError(t, node.TearDown())
})
// We want to overwrite some of the connection settings to make the
// tests more robust. We might need to restart the backend while there
// are already blocks present, which will take a bit longer than the
// 1 second the default settings amount to. Doubling both values will
// give us retries up to 4 seconds.
node.MaxConnRetries = rpctest.DefaultMaxConnectionRetries * 2
node.ConnectionRetryTimeout = rpctest.DefaultConnectionRetryTimeout * 2
if err := node.SetUp(createChain, spendableOutputs); err != nil {
t.Fatalf("unable to set up backend node: %v", err)
}