Skip to content

disable save #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ usage: RLTest [-h] [--version] [--module MODULE] [--module-args MODULE_ARGS]
[--shards-count SHARDS_COUNT] [--download-enterprise-binaries]
[--proxy-binary-path PROXY_BINARY_PATH]
[--enterprise-lib-path ENTERPRISE_LIB_PATH] [-r]
[--use-aof] [--use-rdb-preamble]
[--use-aof] [--use-rdb-preamble] [--disable-save]
[--debug-print] [-V] [--vg-suppressions VG_SUPPRESSIONS]
[--vg-options VG_OPTIONS] [--vg-no-leakcheck] [--vg-verbose]
[--vg-no-fail-on-errors] [-i] [--debugger DEBUGGER] [-s]
Expand Down Expand Up @@ -125,6 +125,7 @@ optional arguments:
taken down. (default: False)
--use-aof use aof instead of rdb (default: False)
--use-rdb-preamble use rdb preamble when rewriting aof file (default: True)
--disable-save disable redis save (default: False)
--debug-print print debug messages (default: False)
-V, --vg, --use-valgrind
running redis under valgrind (assuming valgrind is
Expand Down
3 changes: 3 additions & 0 deletions RLTest/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ def do_normal_conn(self, line):
parser.add_argument(
'--tls-ca-cert-file', default=None, help='/path/to/ca.crt')

parser.add_argument('--disable-save', action="store_true", help='Disable Redis save', default=False, dest='disable_save')

class EnvScopeGuard:
def __init__(self, runner):
self.runner = runner
Expand Down Expand Up @@ -403,6 +405,7 @@ def __init__(self):
Defaults.cluster_node_timeout = self.args.cluster_node_timeout
if Defaults.use_unix and Defaults.use_slaves:
raise Exception('Cannot use unix sockets with slaves')
Defaults.disable_save = self.args.disable_save

self.tests = []
self.testsFailed = []
Expand Down
7 changes: 5 additions & 2 deletions RLTest/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ class Defaults:
randomize_ports = False
oss_password = None
cluster_node_timeout = None
disable_save = False

def getKwargs(self):
kwargs = {
Expand Down Expand Up @@ -166,7 +167,7 @@ def __init__(self, testName=None, testDescription=None, module=None,
moduleArgs=None, env=None, useSlaves=None, shardsCount=None, decodeResponses=None,
useAof=None, useRdbPreamble=None, forceTcp=False, useTLS=False, tlsCertFile=None, tlsKeyFile=None,
tlsCaCertFile=None, logDir=None, redisBinaryPath=None, dmcBinaryPath=None,
redisEnterpriseBinaryPath=None, noDefaultModuleArgs=False, clusterNodeTimeout = None):
redisEnterpriseBinaryPath=None, noDefaultModuleArgs=False, clusterNodeTimeout = None, disableSave = False):

self.testName = testName if testName else '%s.%s' % (inspect.getmodule(inspect.currentframe().f_back).__name__, inspect.currentframe().f_back.f_code.co_name)
self.testName = self.testName.replace(' ', '_')
Expand Down Expand Up @@ -198,6 +199,7 @@ def __init__(self, testName=None, testDescription=None, module=None,
self.dmcBinaryPath = expandBinary(dmcBinaryPath) if dmcBinaryPath else Defaults.proxy_binary
self.redisEnterpriseBinaryPath = expandBinary(redisEnterpriseBinaryPath) if redisEnterpriseBinaryPath else Defaults.re_binary
self.clusterNodeTimeout = clusterNodeTimeout if clusterNodeTimeout else Defaults.cluster_node_timeout
self.disableSave = disableSave if disableSave else Defaults.disable_save

self.assertionFailedSummary = []

Expand Down Expand Up @@ -293,7 +295,8 @@ def getEnvKwargs(self):
'tlsCertFile': self.tlsCertFile,
'tlsKeyFile': self.tlsKeyFile,
'tlsCaCertFile': self.tlsCaCertFile,
'clusterNodeTimeout': self.clusterNodeTimeout
'clusterNodeTimeout': self.clusterNodeTimeout,
'disableSave': self.disableSave
}
return kwargs

Expand Down
7 changes: 5 additions & 2 deletions RLTest/redis_std.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class StandardEnv(object):
def __init__(self, redisBinaryPath, port=6379, modulePath=None, moduleArgs=None, outputFilesFormat=None,
dbDirPath=None, useSlaves=False, serverId=1, password=None, libPath=None, clusterEnabled=False, decodeResponses=False,
useAof=False, useRdbPreamble=True, debugger=None, noCatch=False, unix=False, verbose=False, useTLS=False, tlsCertFile=None,
tlsKeyFile=None, tlsCaCertFile=None, clusterNodeTimeout = None):
tlsKeyFile=None, tlsCaCertFile=None, clusterNodeTimeout = None, disableSave = False):
self.uuid = uuid.uuid4().hex
self.redisBinaryPath = os.path.expanduser(redisBinaryPath) if redisBinaryPath.startswith(
'~/') else redisBinaryPath
Expand Down Expand Up @@ -53,6 +53,7 @@ def __init__(self, redisBinaryPath, port=6379, modulePath=None, moduleArgs=None,
self.tlsKeyFile = tlsKeyFile
self.tlsCaCertFile = tlsCaCertFile
self.clusterNodeTimeout = clusterNodeTimeout
self.disableSave = disableSave

if port > 0:
self.port = port
Expand Down Expand Up @@ -169,7 +170,8 @@ def createCmdArgs(self, role):
if arg.strip() != '':
args += arg.split(' ')
cmdArgs += args

if self.disableSave:
cmdArgs += ['--save', '']
if self.dbDirPath is not None:
cmdArgs += ['--dir', self.dbDirPath]
if self.outputFilesFormat is not None and not self.noCatch:
Expand All @@ -193,6 +195,7 @@ def createCmdArgs(self, role):
cmdArgs += ['--appendfilename', self._getFileName(role, '.aof')]
if not self.useRdbPreamble:
cmdArgs += ['--aof-use-rdb-preamble', 'no']

if self.useTLS:
cmdArgs += ['--tls-cert-file', self.getTLSCertFile()]
cmdArgs += ['--tls-key-file', self.getTLSKeyFile()]
Expand Down