aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/DropRateSearch.py
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries/python/DropRateSearch.py')
-rw-r--r--resources/libraries/python/DropRateSearch.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/resources/libraries/python/DropRateSearch.py b/resources/libraries/python/DropRateSearch.py
index 912d2e9f53..9b7c46668d 100644
--- a/resources/libraries/python/DropRateSearch.py
+++ b/resources/libraries/python/DropRateSearch.py
@@ -403,10 +403,9 @@ class DropRateSearch(object):
while True:
res = []
for dummy in range(self._max_attempts):
- res.append(self.measure_loss(rate, self._frame_size,
- self._loss_acceptance,
- self._loss_acceptance_type,
- traffic_type))
+ res.append(self.measure_loss(
+ rate, self._frame_size, self._loss_acceptance,
+ self._loss_acceptance_type, traffic_type))
res = self._get_res_based_on_search_type(res)
@@ -475,11 +474,10 @@ class DropRateSearch(object):
:rtype: tuple
:raises Exception: If search failed.
"""
- if self._search_result == SearchResults.FAILURE:
- raise Exception('Search FAILED')
- elif self._search_result in [SearchResults.SUCCESS,
- SearchResults.SUSPICIOUS]:
+ if self._search_result in [
+ SearchResults.SUCCESS, SearchResults.SUSPICIOUS]:
return self._search_result_rate, self.get_latency()
+ raise Exception('Search FAILED')
def binary_search(self, b_min, b_max, traffic_type, skip_max_rate=False,
skip_warmup=False):