Commit a5657ba1 authored by Rafael Monnerat's avatar Rafael Monnerat

Remove computer id from TestMap if there isn't more tests to him.

This change also replace break by continue, in order to try next computer,
if others computers exist.
parent d3cd5e31
......@@ -326,6 +326,9 @@ class TestMap(object):
def getComputerList(self):
return self.test_map_dict.keys()
def dropComputer(self, computer_id):
del self.test_map_dict[computer_id]
def cleanUp(self):
for key in self.test_map_dict.copy():
if len(self.test_map_dict[key]) == 0:
......@@ -338,7 +341,6 @@ class TestMap(object):
return None
def main():
"""
Note: This code does not test as much as it monitors.
......@@ -466,8 +468,10 @@ def main():
logger.info("Running test dict: %s " % running_test_dict)
logger.info("Target Computer: %s " % target_computer)
if test_line is None:
test_mapping.dropComputer(target_computer)
if len(test_mapping.getComputerList()) == 0:
more_tests = False
break
continue
test_name = test_line.name
try:
section_entry_dict = section_dict[test_name]
......@@ -515,6 +519,7 @@ def main():
running_test_dict[test_name] = (test_line, tester, target_computer)
if not running_test_dict:
break
now = time.time()
# Synchronise refreshes on watcher period, so it doesn't report a
# stalled test node where we are actually still sleeping.
......
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