Skip to content

Commit 8538b81

Browse files
committed
[ot] python/qemu: ot.pyot.util: fix execution time computation
Some fail test may report no execution time. Signed-off-by: Emmanuel Blot <[email protected]>
1 parent db06b41 commit 8538b81

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/qemu/ot/pyot/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ def show(self, spacing: bool = False, result: Optional[str] = None) -> None:
6767
if spacing:
6868
print('')
6969
# third row is time, always defined as ms, see ExecTime
70-
total_time = sum(float(r[2].strip().split(' ')[0])
71-
for r in self._results[1:])
70+
exec_times = [r[2].strip().split(' ')[0] for r in self._results[1:]]
71+
total_time = sum(float(t) for t in exec_times if t)
7272
tt_str = f'{total_time / 1000:.1f} s'
7373
last_row = ['TEST SESSION', result or '?', tt_str]
7474
last_row.extend([''] * (len(self._results) - len(last_row)))

0 commit comments

Comments
 (0)