You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by lh...@apache.org on 2019/11/27 01:21:57 UTC

[samza] branch 1.3.0 updated: SAMZA-2403: fix standalone integration failure (#1225)

This is an automated email from the ASF dual-hosted git repository.

lhaiesp pushed a commit to branch 1.3.0
in repository https://gitbox.apache.org/repos/asf/samza.git


The following commit(s) were added to refs/heads/1.3.0 by this push:
     new 23e32ff  SAMZA-2403: fix standalone integration failure (#1225)
23e32ff is described below

commit 23e32fffa9f2d6732071fa4ee4230e69d2596e77
Author: Hai Lu <ha...@linkedin.com>
AuthorDate: Tue Nov 26 17:15:44 2019 -0800

    SAMZA-2403: fix standalone integration failure (#1225)
---
 samza-test/src/main/python/tests/zk_client.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/samza-test/src/main/python/tests/zk_client.py b/samza-test/src/main/python/tests/zk_client.py
index f5716e4..a1cf525 100644
--- a/samza-test/src/main/python/tests/zk_client.py
+++ b/samza-test/src/main/python/tests/zk_client.py
@@ -31,7 +31,7 @@ class ZkClient:
     Instantiates a kazoo client to connect to zookeeper server at :param zookeeper_host::param zookeeper_port.
     """
     def __init__(self, zookeeper_host, zookeeper_port, app_name, app_id):
-        self.protocol_version = "1.0"
+        self.protocol_version = "2.0"
         self.kazoo_client = KazooClient(hosts='{0}:{1}'.format(zookeeper_host, zookeeper_port))
         self.zk_base_node = 'app-{0}-{1}/{2}-{3}-{4}-coordinationData'.format(app_name, app_id, app_name, app_id, self.protocol_version)
 
@@ -62,7 +62,7 @@ class ZkClient:
                 childZkNodes.sort()
                 childZkNodes.reverse()
 
-                job_model_generation_path = '{0}/jobModelGeneration/jobModels/{1}/'.format(self.zk_base_node, childZkNodes[0])
+                job_model_generation_path = '{0}/jobModelGeneration/jobModels/{1}/0'.format(self.zk_base_node, childZkNodes[0])
                 job_model, _ = self.kazoo_client.get(job_model_generation_path)
 
                 """
@@ -75,7 +75,8 @@ class ZkClient:
                 """
 
                 first_curly_brace_index = job_model.find('{')
-                job_model = job_model[first_curly_brace_index: ]
+                last_curly_brace_index = job_model.rindex('}')
+                job_model = job_model[first_curly_brace_index: last_curly_brace_index + 1]
                 job_model_dict = json.loads(job_model)
                 logger.info("Recent JobModel in zookeeper: {0}".format(job_model_dict))
         except: