sys.path.append( os.path.abspath( os.path.join(os.path.dirname(__file__), os.path.pardir, 'common'))) import driver, scenario_common, utils, vcoptparse try: xrange except NameError: xrange = range # Don't allow someone to run this without unlimited size core files - which are really useful for debugging assert resource.getrlimit(resource.RLIMIT_CORE)[0] == resource.RLIM_INFINITY opts = vcoptparse.OptParser() scenario_common.prepare_option_parser_mode_flags(opts) opts['random-seed'] = vcoptparse.FloatFlag('--random-seed', random.random()) opts['servers'] = vcoptparse.IntFlag('--servers', 1) # Number of servers in the cluster opts['duration'] = vcoptparse.IntFlag( '--duration', 900) # Time to perform fuzzing in seconds opts['progress'] = vcoptparse.BoolFlag( '--progress', False) # Write messages every 10 seconds with the time remaining opts['threads'] = vcoptparse.IntFlag( '--threads', 16) # Number of client threads to run (not counting changefeeds) opts['changefeeds'] = vcoptparse.BoolFlag( '--changefeeds', False) # Whether or not to use changefeeds opts['kill'] = vcoptparse.BoolFlag( '--kill', False
returnValue += (int(step),) except: workingValue = returnValue[-1] for char in step: if char == '-': workingValue -= 1 elif char == '+': workingValue += 1 else: raise ValueError('Got a bad step value: %s' % repr(char)) assert char in ('-', '+') returnValue += (workingValue,) return returnValue op = vcoptparse.OptParser() scenario_common.prepare_option_parser_mode_flags(op) workload_runner.prepare_option_parser_for_split_or_continuous_workload(op, allow_between = True) op["num-nodes"] = vcoptparse.IntFlag("--num-nodes", 3) op["sequence"] = vcoptparse.ValueFlag("--sequence", converter=sequence_from_string, default=(2, 3)) opts = op.parse(sys.argv) _, command_prefix, serve_options = scenario_common.parse_mode_flags(opts) class Rebalance(rdb_unittest.RdbTestCase): '''Change the number of shards on a table.''' # keep the same number of replicas as nodes so we don't have to backfill constantly replicas = opts["num-nodes"] shards = 1 server_command_prefix = command_prefix server_extra_options = serve_options