

def test_registered_functions(self):
    'Test the correct functions are registered with gearman'
    self.start_server()
    t0 = time.time()
    failed = True
    while ((time.time() - t0) < 10):
        if (len(self.gearman_server.functions) == 4):
            failed = False
            break
        time.sleep(0.01)
    if failed:
        self.log.debug(self.gearman_server.functions)
        self.fail("The correct number of functions haven't registered with gearman")
    hostname = os.uname()[1]
    self.assertIn(('stop:turbo-hipster-manager-%s' % hostname), self.gearman_server.functions)

dataset/ETHPy150Open openstack/turbo-hipster/tests/disabled_worker_manager.py TestZuulManager.test_registered_functions/original