Skip to content

Commit fedd90a

Browse files
committed
Add logging for benchmark error
1 parent cb968f9 commit fedd90a

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

tests/benchmark.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import print_function
22
from sys import hexversion
3+
import logging
34

45
import time, random, argparse
56
from functools import partial
@@ -124,6 +125,20 @@ def main(name):
124125
if name not in kind_names:
125126
continue
126127
details = impls[test][name]
127-
benchmark(tests[test], name, details['ctor'], details['setup'], details['func'], details['limit'])
128+
try:
129+
benchmark(
130+
tests[test],
131+
name,
132+
details['ctor'],
133+
details['setup'],
134+
details['func'],
135+
details['limit'],
136+
)
137+
except Exception:
138+
logging.exception('Benchmark Error')
139+
logging.error('Test: %s', test)
140+
logging.error('Name: %s', name)
141+
for key in sorted(details):
142+
logging.error('Details[%r]: %s', key, details[key])
128143

129144
detail('Benchmark Stop')

0 commit comments

Comments
 (0)