Skip to content

Commit b421ffb

Browse files
devanshsa5vikas-getconnect
authored andcommitted
CBPS-1173 Handling exceptions properly for eventing.py
Change-Id: Ic047949346c4946f46cf6c13a15c542f6cf1f2d9 Reviewed-on: https://review.couchbase.org/c/perfrunner/+/192064 Tested-by: Build Bot <[email protected]> Reviewed-by: Devansh Srivastava <[email protected]> Reviewed-by: vikas chaudhary <[email protected]>
1 parent dff6863 commit b421ffb

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

perfrunner/tests/eventing.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def resume(self, func_scope=None) -> int:
279279
logger.info("Function {} is resumed.".format(name))
280280
return time_to_resume
281281

282-
def validate_failures(self):
282+
def validate_failures(self) -> str:
283283
ignore_failures = ["uv_try_write_failure_counter",
284284
"bucket_op_exception_count", "timestamp",
285285
"bkt_ops_cas_mismatch_count", "bucket_op_cache_miss_count",
@@ -297,16 +297,14 @@ def validate_failures(self):
297297
# Validate Execution stats
298298
for stat, value in execution_stats.items():
299299
if "failure" in stat and value != 0 and stat not in ignore_failures:
300-
raise Exception(
301-
'{function}: {node}: {stat} is not zero'.format(
302-
function=function_stats["function_name"], node=node, stat=stat))
300+
return '{function}: {node}: {stat} is not zero'.format(
301+
function=function_stats["function_name"], node=node, stat=stat)
303302

304303
# Validate Failure stats
305304
for stat, value in failure_stats.items():
306305
if value != 0 and stat not in ignore_failures:
307-
raise Exception(
308-
'{function}: {node}: {stat} is not zero'.format(
309-
function=function_stats["function_name"], node=node, stat=stat))
306+
return '{function}: {node}: {stat} is not zero'.format(
307+
function=function_stats["function_name"], node=node, stat=stat)
310308

311309
def print_max_rss_values(self):
312310
for node in self.eventing_nodes:
@@ -323,8 +321,8 @@ def print_max_rss_values(self):
323321

324322
def debug(self):
325323
self.print_max_rss_values()
326-
self.validate_failures()
327-
return super().debug()
324+
failure = self.validate_failures()
325+
return failure or super().debug()
328326

329327
def run(self):
330328
self.set_functions()

0 commit comments

Comments
 (0)