def test_memleak_get_conf(self): """测试get_conf是否有内存泄露 """ key = "/test_group/service/codis" i = 0 while i < 1: qconf.get_conf(key) i = i + 1
def _get_qconf_data(self): """解决qconf get_batch_conf有内存泄露问题 """ qconf_data = {} data_keys = qconf.get_batch_keys(self.zk_path) for _key in data_keys: node_key = "{}/{}".format(self.zk_path, _key) qconf_data[_key] = qconf.get_conf(node_key) return qconf_data
def test_api(self): """测试基本api """ key = "/test_group/service/codis" value = qconf.get_conf(key) keys = qconf.get_batch_keys(key) assert isinstance(keys, list) children = qconf.get_batch_conf(key) assert isinstance(children, dict)