Commit e8abb19b authored by Grégory Wisniewski's avatar Grégory Wisniewski

Handle properly failures in matrix runner.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1769 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 634f2775
...@@ -4,6 +4,7 @@ import sys ...@@ -4,6 +4,7 @@ import sys
import os import os
import math import math
import optparse import optparse
import traceback
from time import time from time import time
from neo.tests.functional import NEOCluster from neo.tests.functional import NEOCluster
...@@ -35,7 +36,8 @@ def run(masters, storages, replicas, partitions, datafs, verbose): ...@@ -35,7 +36,8 @@ def run(masters, storages, replicas, partitions, datafs, verbose):
neo_storage.copyTransactionsFrom(dfs_storage) neo_storage.copyTransactionsFrom(dfs_storage)
return time() - start return time() - start
except: except:
return -1 traceback.print_exc()
return None
finally: finally:
neo.stop() neo.stop()
...@@ -45,8 +47,10 @@ def runMatrix(datafs, storages, replicas, verbose): ...@@ -45,8 +47,10 @@ def runMatrix(datafs, storages, replicas, verbose):
for s in storages: for s in storages:
for r in [r for r in replicas if r < s]: for r in [r for r in replicas if r < s]:
stats.setdefault(s, {}) stats.setdefault(s, {})
speed = size / run(1, s, r, 100, datafs, verbose) result = run(1, s, r, 100, datafs, verbose)
stats[s][r] = speed / 1024 if result is not None:
result = size / result / 1024
stats[s][r] = result
return stats return stats
def buildArray(storages, replicas, results): def buildArray(storages, replicas, results):
...@@ -61,6 +65,9 @@ def buildArray(storages, replicas, results): ...@@ -61,6 +65,9 @@ def buildArray(storages, replicas, results):
assert s in results assert s in results
for r in replicas: for r in replicas:
if r in results[s]: if r in results[s]:
if results[s][r] is None:
values.append('FAIL')
else:
values.append('%8.1f' % results[s][r]) values.append('%8.1f' % results[s][r])
else: else:
values.append('N/A') values.append('N/A')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment