Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
labisso committed Dec 19, 2012
1 parent a8e4952 commit e1c232b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
14 changes: 4 additions & 10 deletions epu/highavailability/test/test_highavailability_service.py
Expand Up @@ -84,6 +84,7 @@
logfile: /tmp/eeagent_nodetwo.log
"""


class HighAvailabilityServiceMixin(unittest.TestCase):

def _update_policy_params_and_assert(self, new_params, maxattempts=None):
Expand Down Expand Up @@ -192,7 +193,6 @@ def _assert_n_processes(self, n, timeout=None, only_pd=None):
assert False, "HA took more than %ss to get to %s processes. Had %s" % (timeout, n, processes)



class HighAvailabilityServiceTests(HighAvailabilityServiceMixin, TestFixture):

def setUp(self):
Expand All @@ -217,10 +217,7 @@ def setUp(self):

self.epuharness.start(deployment_str=deployment)

# Ensure that all of the PDs are up
for pd in self.pd_names:
pd_client = ProcessDispatcherClient(self.dashi, pd)
pd_client.dump()
self.block_until_ready(deployment, self.dashi)

self.haservice = HighAvailabilityService(policy_parameters=policy_params,
process_dispatchers=self.pd_names, exchange=self.exchange,
Expand Down Expand Up @@ -334,6 +331,7 @@ def test_missing_proc(self):
self._assert_n_processes(n)
print self._get_all_procs()


class HighAvailabilityServiceOnePDTests(HighAvailabilityServiceMixin, TestFixture):

def setUp(self):
Expand All @@ -360,11 +358,7 @@ def setUp(self):
self.addCleanup(self.cleanup_harness)

self.epuharness.start(deployment_str=deployment_one_pd_two_eea)

# Ensure that all of the PDs are up
for pd in self.pd_names:
pd_client = ProcessDispatcherClient(self.dashi, pd)
pd_client.dump()
self.block_until_ready(deployment, self.dashi)

self.haservice = HighAvailabilityService(policy_parameters=policy_params,
process_dispatchers=self.pd_names, exchange=self.exchange,
Expand Down
Expand Up @@ -67,7 +67,7 @@ def setup_store(self):
return ProcessDispatcherStore()

def teardown_store(self):
return
self.store.shutdown()

def _spawn_eeagent(self, node_id, slot_count, heartbeat_dest=None):
if heartbeat_dest is None:
Expand Down
6 changes: 3 additions & 3 deletions epu/provisioner/test/util.py
Expand Up @@ -86,12 +86,12 @@ def _send_record_internal(self, record, subscribers):
log.debug('Got updated state record for node %s: %s -> %s',
node_id, old_state, state)
else:
log.debug('Got out-of-order record for node %s. %s -> %s',
log.debug('Got out-of-order record for node %s. %s -> %s',
node_id, old_state, state)
else:
self.nodes[node_id] = record
self.nodes_rec_count[node_id] = 1
log.debug('Recorded new state record for node %s: %s',
log.debug('Recorded new state record for node %s: %s',
node_id, state)

if subscribers:
Expand Down Expand Up @@ -153,7 +153,7 @@ def assure_subscribers(self, node_id, subscribers):
return True

def wait_for_state(self, state, nodes=None,
before=None, before_kwargs=None, timeout=10):
before=None, before_kwargs=None, timeout=30):
import time

if before_kwargs is None:
Expand Down

0 comments on commit e1c232b

Please sign in to comment.