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