Esempio n. 1
0
class DTRSZooKeeperStoreProxyKillsTests(BaseDTRSStoreTests, ZooKeeperTestMixin):

    # this runs all of the BaseDTRSStoreTests tests plus any
    # ZK-specific ones, but uses a proxy in front of ZK and restarts
    # the proxy before each call to the store. The effect is that for each store
    # operation, the first call to kazoo fails with a connection error, but the
    # client should handle that and retry

    def setUp(self):
        self.setup_zookeeper(base_path_prefix="/dtrs_store_tests_", use_proxy=True)
        self.real_store = DTRSZooKeeperStore(self.zk_hosts, self.zk_base_path, use_gevent=self.use_gevent)

        self.real_store.initialize()

        # have the tests use a wrapped store that restarts the connection before each call
        self.store = SocatProxyRestartWrapper(self.proxy, self.real_store)

    def tearDown(self):
        self.teardown_zookeeper()

    def test_the_fixture(self):
        # make sure test fixture actually works like we think

        def fake_operation():
            self.store.kazoo.get("/")
        self.real_store.fake_operation = fake_operation

        self.assertRaises(ConnectionLoss, self.store.fake_operation)
Esempio n. 2
0
class DTRSZooKeeperStoreTests(BaseDTRSStoreTests, ZooKeeperTestMixin):

    # this runs all of the BaseDTRSStoreTests tests plus any
    # ZK-specific ones

    def setUp(self):
        self.setup_zookeeper(base_path_prefix="/dtrs_store_tests_")
        self.store = DTRSZooKeeperStore(self.zk_hosts, self.zk_base_path, use_gevent=self.use_gevent)

        self.store.initialize()

    def tearDown(self):
        self.teardown_zookeeper()
Esempio n. 3
0
    def setUp(self):
        self.setup_zookeeper(base_path_prefix="/dtrs_store_tests_", use_proxy=True)
        self.real_store = DTRSZooKeeperStore(self.zk_hosts, self.zk_base_path, use_gevent=self.use_gevent)

        self.real_store.initialize()

        # have the tests use a wrapped store that restarts the connection before each call
        self.store = SocatProxyRestartWrapper(self.proxy, self.real_store)
Esempio n. 4
0
    def setUp(self):
        self.setup_zookeeper(base_path_prefix="/dtrs_store_tests_")
        self.store = DTRSZooKeeperStore(self.zk_hosts, self.zk_base_path, use_gevent=self.use_gevent)

        self.store.initialize()