Skip to content

Commit

Permalink
Merge pull request #2412 from waprin/fix_400
Browse files Browse the repository at this point in the history
Add More Retries to 400 on Query
  • Loading branch information
dhermes authored Sep 24, 2016
2 parents af4f346 + e0da2ea commit 5edcaaf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions system_tests/monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,14 @@ def test_write_point(self):
retry_500(client.write_point)(metric, resource, VALUE)

def _query_timeseries_with_retries():
MAX_RETRIES = 7

def _has_timeseries(result):
return len(list(result)) > 0
retry_result = RetryResult(_has_timeseries, max_tries=7)(
client.query)
return RetryErrors(BadRequest)(retry_result)

retry_result = RetryResult(_has_timeseries,
max_tries=MAX_RETRIES)(client.query)
return RetryErrors(BadRequest, max_tries=MAX_RETRIES)(retry_result)

query = _query_timeseries_with_retries()(METRIC_TYPE, minutes=5)
timeseries_list = list(query)
Expand Down

0 comments on commit 5edcaaf

Please sign in to comment.