From 47bbcfee6ca0a1887a9aaef75e6fad0cdae56a9b Mon Sep 17 00:00:00 2001 From: Eric Solender Date: Wed, 28 Oct 2020 16:52:05 -0400 Subject: [PATCH] fixed test --- config.go | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/config.go b/config.go index 1c80a50..c8d5455 100644 --- a/config.go +++ b/config.go @@ -169,16 +169,22 @@ func setupInit(isTest bool, conf *Config, mapTypes ...interface{}) error { log.WithError(err).Error("failed to validate edges") return err } - if conf.MaxRetries < 0 { - conf.MaxRetries = 0 - } - if conf.RetryWaitDuration == 0 { - // default is 1 second - conf.RetryWaitDuration = time.Second + if isTest && conf != nil { + if conf.MaxRetries < 0 { + conf.MaxRetries = 0 + } + + if conf.RetryWaitDuration == 0 { + // default is 1 second + conf.RetryWaitDuration = time.Second + } + + internalConfig = conf + } else { + internalConfig = &Config{RetryWaitDuration: time.Second, MaxRetries: 0} } - internalConfig = conf if !isTest { log.Debug("opening connection to neo4j") // todo tls support