From 1c0b4fd1de9cb140b06094f309c7ef846a6c3c13 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Tue, 22 Mar 2022 13:54:49 +0100 Subject: [PATCH] chainview: increase connection timeout in test The unit test sometimes fails with a connection timeout when trying to connect to the reorg mining node. We attempt to make things more robust by doubling both the number of retries as well as the retry timeout itself. --- routing/chainview/interface_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/routing/chainview/interface_test.go b/routing/chainview/interface_test.go index c0cb2a5ee..fca3191f4 100644 --- a/routing/chainview/interface_test.go +++ b/routing/chainview/interface_test.go @@ -547,6 +547,14 @@ func testFilterBlockDisconnected(node *rpctest.Harness, } defer reorgNode.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. + reorgNode.MaxConnRetries = rpctest.DefaultMaxConnectionRetries * 2 + reorgNode.ConnectionRetryTimeout = rpctest.DefaultConnectionRetryTimeout * 2 + // This node's chain will be 105 blocks. if err := reorgNode.SetUp(true, 5); err != nil { t.Fatalf("unable to set up mining node: %v", err)