Skip to content

Commit b88eb30

Browse files
committed
bisect_hang.py: introduced a maximum run time factor (default: 1.3)
1 parent 542debb commit b88eb30

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tools/bisect/bisect_hang.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
from bisect_common import *
66

7+
MAX_RT_FACTOR = 1.3
8+
79
# TODO: detect missing file
810
def run(cppcheck_path, options, elapsed_time=None):
911
timeout = None
@@ -85,4 +87,7 @@ def run(cppcheck_path, options, elapsed_time=None):
8587
run_time_factor = run_time / elapsed_time
8688
print('run_time_factor: {}'.format(run_time_factor))
8789

90+
if run_time_factor >= MAX_RT_FACTOR:
91+
sys.exit(EC_BAD if not invert else EC_GOOD) # factor exceeded
92+
8893
sys.exit(EC_GOOD if not invert else EC_BAD) # no timeout

0 commit comments

Comments
 (0)