Skip to content

Commit

Permalink
Augment failovertest.py to start multiple clients
Browse files Browse the repository at this point in the history
This allows you to do things like running the FailOverTest client
alongside the Benchmark client in a convenient way.

I was using it like this (with a large snapshotMinLogSize and maxThreads
defined in smoketest.conf, YMMV):

   ./scripts/failovertest.py \
      --killinterval=120 --launchdelay=60 --timeout=6000 \
      --client='build/Examples/FailoverTest --timeout=30s' \
      --client='build/Examples/Benchmark --threads=100 --size=100 --timeout=1000000 --writes=1000000000000'

This is enough on #168 for my purposes for now.

Close #168: create new system test with server that is far behind
  • Loading branch information
ongardie committed Jun 13, 2015
1 parent 99e3840 commit be018cf
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions scripts/failovertest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
killing servers.
Usage:
failovertest.py [options]
failovertest.py [--client=<cmd>]... [options]
failovertest.py (-h | --help)
Options:
-h --help Show this help message and exit
--binary=<cmd> Server binary to execute [default: build/LogCabin]
--client=<cmd> Client binary to execute
[default: build/Examples/FailoverTest]
[default: 'build/Examples/FailoverTest']
--reconf=<opts> Additional options to pass through to the Reconfigure
binary. [default: '']
--servers=<num> Number of servers [default: 5]
Expand All @@ -49,7 +49,7 @@

def main():
arguments = docopt(__doc__)
client_command = arguments['--client']
client_commands = arguments['--client']
server_command = arguments['--binary']
num_servers = int(arguments['--servers'])
reconf_opts = arguments['--reconf']
Expand Down Expand Up @@ -106,11 +106,12 @@ def launch_server(server_id):
reconf_opts,
' '.join([h[0] for h in smokehosts[:num_servers]])))

print('Starting %s %s on localhost' % (client_command, cluster))
client = sandbox.rsh('localhost',
'%s %s' % (client_command, cluster),
bg=True,
stderr=open('debug/client', 'w'))
for i, client_command in enumerate(client_commands):
print('Starting %s %s on localhost' % (client_command, cluster))
sandbox.rsh('localhost',
'%s %s' % (client_command, cluster),
bg=True,
stderr=open('debug/client%d' % i, 'w'))

start = time.time()
lastkill = start
Expand Down

0 comments on commit be018cf

Please sign in to comment.