Commit 3ffeaac8 authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[tools] Limit number of retries in callstats.py

Abort after reaching MAX_NOF_RETRIES since there is only a very low chance
that the page will keep on working after that.

Change-Id: Ia9e5f3cf69ae2b5ad40a60f86a46800541404862
Bug: v8:7941
Reviewed-on: https://chromium-review.googlesource.com/1134771Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54433}
parent 25ec9d83
......@@ -33,6 +33,9 @@ import scipy.stats
from math import sqrt
MAX_NOF_RETRIES = 5
# Run benchmarks.
def print_command(cmd_args):
......@@ -211,9 +214,13 @@ def run_site(site, domain, args, timeout=None):
print >> f, "URL: {}".format(site)
retries_since_good_run = 0
break
if retries_since_good_run < 6:
timeout += 2 ** retries_since_good_run
retries_since_good_run += 1
if retries_since_good_run > MAX_NOF_RETRIES:
# Abort after too many retries, no point in ever increasing the
# timeout.
print("TOO MANY EMPTY RESULTS ABORTING RUN")
break
timeout += 2 ** retries_since_good_run
retries_since_good_run += 1
print("EMPTY RESULT, REPEATING RUN ({})".format(
retries_since_good_run));
finally:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment