From 4daeb35609e723da06ab2051d1efcfa0b0acba8b Mon Sep 17 00:00:00 2001 From: ionutboangiu Date: Fri, 17 May 2024 21:12:37 +0300 Subject: [PATCH] Reduce client connection attempts to test engine status (tests) 200 -> 16 Previously, considering the fibonacci back off strategy, if engine failed to start it would have tried to attempt connections for 2.862799e+33 years. Now, the amount of attempts is 16, equivalent to around 2 and a half seconds. Should be more than enough, considering that usually 6-7 attempts are enough. --- engine/libtest.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/libtest.go b/engine/libtest.go index 30883d02a..1bf7c07cc 100644 --- a/engine/libtest.go +++ b/engine/libtest.go @@ -345,7 +345,7 @@ func StartEngine(cfgPath string, waitEngine int) (*exec.Cmd, error) { } fib := utils.Fib() var connected bool - for i := 0; i < 200; i++ { + for i := 0; i < 16; i++ { time.Sleep(time.Duration(fib()) * time.Millisecond) if _, err := jsonrpc.Dial(utils.TCP, cfg.ListenCfg().RPCJSONListen); err != nil { utils.Logger.Warning(fmt.Sprintf("Error <%s> when opening test connection to: <%s>",