Skip to content

Commit

Permalink
Added timeout to netperf remote script
Browse files Browse the repository at this point in the history
  • Loading branch information
tedsta committed Mar 6, 2017
1 parent 678c254 commit 283bf51
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,15 @@ def RunNetperf(vm, benchmark_name, server_ip, num_streams):
# Run all of the netperf processes and collect their stdout
# TODO: Record start times of netperf processes on the remote machine

# Give the remote script the max possible test length plus 5 minutes to
# complete
remote_cmd_timeout = \
FLAGS.netperf_test_length * (FLAGS.netperf_max_iter or 1) + 300
remote_script_path = '/tmp/run/%s' % REMOTE_SCRIPT
remote_cmd = '%s --netperf_cmd="%s" --num_streams=%s --port_start=%s' % \
(remote_script_path, netperf_cmd, num_streams, PORT_START)
remote_stdout, _ = vm.RemoteCommand(remote_cmd)
remote_stdout, _ = vm.RemoteCommand(remote_cmd,
timeout=remote_cmd_timeout)

# Decode stdouts, stderrs, and return codes from remote command's stdout
stdouts, stderrs, return_codes = json.loads(remote_stdout)
Expand Down

0 comments on commit 283bf51

Please sign in to comment.