Skip to content

Commit a82f4dc

Browse files
timfelfangerer
authored andcommitted
[GR-23758] Avoid timing out in the CI when running our benchmarks in slow configurations
1 parent 4ffecee commit a82f4dc

File tree

1 file changed

+11
-0
lines changed
  • graalpython/com.oracle.graal.python.benchmarks/python

1 file changed

+11
-0
lines changed

graalpython/com.oracle.graal.python.benchmarks/python/harness.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,17 @@ def run(self):
292292
else:
293293
print("### iteration=%s, name=%s, duration=%s" % (iteration, self.bench_module.__name__,
294294
duration_str))
295+
# a bit of fuzzy logic to avoid timing out on configurations
296+
# that are slow, without having to rework our logic for getting
297+
# default iterations
298+
if os.environ.get("CI") and iteration >= 4 and duration > 20:
299+
import statistics
300+
v = durations[-4:]
301+
if statistics.stdev(v) / min(v) < 0.03:
302+
# with less than 3 percent variance across ~20s
303+
# iterations, we can safely stop here
304+
break
305+
295306

296307
print(_HRULE)
297308
print("### teardown ... ")

0 commit comments

Comments
 (0)