You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@heron.apache.org by GitBox <gi...@apache.org> on 2018/08/24 07:50:04 UTC

[GitHub] huijunwu closed pull request #3004: Yaoli/fix stateful test

huijunwu closed pull request #3004: Yaoli/fix stateful test
URL: https://github.com/apache/incubator-heron/pull/3004
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/integration_test/src/python/http_server/main.py b/integration_test/src/python/http_server/main.py
index c4bfde4900..9a7dcd123f 100644
--- a/integration_test/src/python/http_server/main.py
+++ b/integration_test/src/python/http_server/main.py
@@ -106,7 +106,12 @@ def post(self, key):
     data = tornado.escape.json_decode(self.request.body)
     if key:
       if key in self.result_map:
-        self.result_map[key].append(data)
+        # fix the duplicate record issue
+        for comp in self.result_map[key]:
+          if comp.keys()[0] == data.keys()[0]:
+            break
+        else:
+          self.result_map[key].append(data)
       else:
         self.result_map[key] = [data]
       self.write("Results written successfully: topology " + key + ' instance ' + data.keys()[0])
@@ -128,11 +133,11 @@ def main():
   # for instance states in stateful processing
   state_result_map = {}
   application = tornado.web.Application([
-      (r"/", MainHandler),
-      (r"^/results/([a-zA-Z0-9_-]+$)", FileHandler),
-      (r"^/state", MemoryMapGetAllHandler, dict(state_map=state_map)),
-      (r"^/state/([a-zA-Z0-9_-]+$)", MemoryMapHandler, dict(state_map=state_map)),
-      (r"^/stateResults/([a-zA-Z0-9_-]+$)", StateResultHandler, dict(result_map=state_result_map)),
+    (r"/", MainHandler),
+    (r"^/results/([a-zA-Z0-9_-]+$)", FileHandler),
+    (r"^/state", MemoryMapGetAllHandler, dict(state_map=state_map)),
+    (r"^/state/([a-zA-Z0-9_-]+$)", MemoryMapHandler, dict(state_map=state_map)),
+    (r"^/stateResults/([a-zA-Z0-9_-]+$)", StateResultHandler, dict(result_map=state_result_map)),
   ])
 
   if len(sys.argv) == 1:


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services