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.
This commit is contained in:
ionutboangiu
2024-05-17 21:12:37 +03:00
committed by Dan Christian Bogos
parent 7e663e7b60
commit 4daeb35609

View File

@@ -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>",