Commit 3d1bb7b9 authored by Paul Rich's avatar Paul Rich
Browse files

adding in test and decrement if we're changing away from a forker.

parent c0397af6
......@@ -175,6 +175,7 @@ class ProcessGroupManager(object): #degenerate with ProcessMonitor.
except ComponentLookupError:
# Retry this with a different forker, if we run out of forkers, then this startup fails.
self.forker_reachable[process_group.forker] = False
self.forker_taskcounts[process_group.forker] -= 1 #decrement since we failed to use this forker.
process_group.forker = self._select_forker(process_group.jobid)
except RuntimeError as err:
......@@ -167,6 +167,8 @@ class TestProcessManager(object):
assert self.process_manager.process_groups[1].startup_timeout == 0, (
"startup_timeout not reset")
assert_match(self.process_manager.process_groups[1].forker, 'forker2', "Wrong forker selected")
assert_match(self.process_manager.forker_taskcounts['forker1'], 0, "Wrong count forker1")
assert_match(self.process_manager.forker_taskcounts['forker2'], 2, "Wrong count forker2")
@patch.object(Cobalt.Proxy.DeferredProxyMethod, '__call__', return_value=1,
side_effect=Cobalt.Exceptions.ComponentLookupError('failed lookup'))
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