@@ -23,7 +23,7 @@ def __init__(self, redisBinaryPath, port=6379, modulePath=None, moduleArgs=None,
2323 useAof = False , useRdbPreamble = True , debugger = None , sanitizer = None , noCatch = False , noLog = False , unix = False , verbose = False , useTLS = False ,
2424 tlsCertFile = None , tlsKeyFile = None , tlsCaCertFile = None , clusterNodeTimeout = None , tlsPassphrase = None , enableDebugCommand = False , protocol = 2 ,
2525 terminateRetries = None , terminateRetrySecs = None , enableProtectedConfigs = False , enableModuleCommand = False , loglevel = None ,
26- redisConfigFile = None , dualTLS = False
26+ redisConfigFile = None , dualTLS = False , startupGraceSecs = 0.1
2727 ):
2828 self .uuid = uuid .uuid4 ().hex
2929 self .redisBinaryPath = os .path .expanduser (redisBinaryPath ) if redisBinaryPath .startswith (
@@ -72,6 +72,7 @@ def __init__(self, redisBinaryPath, port=6379, modulePath=None, moduleArgs=None,
7272 self .terminateRetrySecs = terminateRetrySecs
7373 self .redisConfigFile = redisConfigFile
7474 self .dualTLS = dualTLS
75+ self .startupGraceSecs = startupGraceSecs
7576
7677 if port > 0 :
7778 self .port = port
@@ -381,7 +382,7 @@ def startEnv(self, masters = True, slaves = True):
381382 if masters and self .masterProcess is None :
382383 self .masterProcess = subprocess .Popen (args = self .masterCmdArgs , env = self .masterOSEnv , cwd = self .dbDirPath ,
383384 ** options )
384- time .sleep (0.1 )
385+ time .sleep (self . startupGraceSecs )
385386 if self ._isAlive (self .masterProcess ):
386387 con = self .getConnection ()
387388 self .waitForRedisToStart (con , self .masterProcess )
@@ -392,7 +393,7 @@ def startEnv(self, masters = True, slaves = True):
392393 print (Colors .Green ("Redis slave command: " + ' ' .join (self .slaveCmdArgs )))
393394 self .slaveProcess = subprocess .Popen (args = self .slaveCmdArgs , env = self .slaveOSEnv , cwd = self .dbDirPath ,
394395 ** options )
395- time .sleep (0.1 )
396+ time .sleep (self . startupGraceSecs )
396397 if self ._isAlive (self .slaveProcess ):
397398 con = self .getSlaveConnection ()
398399 self .waitForRedisToStart (con , self .slaveProcess )
0 commit comments