summaryrefslogtreecommitdiff
path: root/tko/parsers
diff options
context:
space:
mode:
authorjadmanski <jadmanski@592f7852-d20e-0410-864c-8624ca9c26a4>2009-05-06 20:25:46 +0000
committerjadmanski <jadmanski@592f7852-d20e-0410-864c-8624ca9c26a4>2009-05-06 20:25:46 +0000
commite3c1a3ae51f1a29e7bed1c7504b20f26050906c4 (patch)
tree5ad9d79db17c527911d56e508121bb7ea9e05b2a /tko/parsers
parent12d552f12c299ab7e2b73bdab38f7d96c705e7c2 (diff)
Use a set instead of a list to store currently running reasons, and
sort it when combining multiple entries into a string. This eliminates duplicates and forces a "standard" ordering. Risk: Low Visibility: Eliminate duplicate warnings from the status log. Signed-off-by: John Admanski <jadmanski@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@3093 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'tko/parsers')
-rw-r--r--tko/parsers/version_1.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tko/parsers/version_1.py b/tko/parsers/version_1.py
index 1e06878c..c78bab7f 100644
--- a/tko/parsers/version_1.py
+++ b/tko/parsers/version_1.py
@@ -179,7 +179,7 @@ class parser(base.parser):
started_time_stack = [None]
subdir_stack = [None]
running_test = None
- running_reasons = []
+ running_reasons = set()
yield [] # we're ready to start running
# create a RUNNING SERVER_JOB entry to represent the entire test
@@ -258,9 +258,9 @@ class parser(base.parser):
min_stack_size = stack.size()
elif stack.size() == min_stack_size + 1 and not running_test:
# we just started a new test, insert a running record
- running_reasons = []
+ running_reasons = set()
if line.reason:
- running_reasons.append(line.reason)
+ running_reasons.add(line.reason)
running_test = test.parse_partial_test(self.job,
line.subdir,
line.testname,
@@ -291,8 +291,9 @@ class parser(base.parser):
if line.reason:
# update the status of a currently running test
if running_test:
- running_reasons.append(line.reason)
- running_test.reason = ", ".join(running_reasons)
+ running_reasons.add(line.reason)
+ sorted_reasons = sorted(running_reasons)
+ running_test.reason = ", ".join(sorted_reasons)
current_reason = running_test.reason
new_tests.append(running_test)
msg = "update RUNNING reason: %s" % line.reason