storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject [1/3] storm git commit: STORM-859 Add regression test of STORM-856
Date Wed, 05 Aug 2015 20:02:12 GMT
Repository: storm
Updated Branches:
  refs/heads/master 3b2c7fc41 -> 7f181188b


STORM-859 Add regression test of STORM-856


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/12cd0988
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/12cd0988
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/12cd0988

Branch: refs/heads/master
Commit: 12cd098826dba7a7b3a20bf90341449c5130eab8
Parents: 58372f0
Author: Jungtaek Lim <kabhwan@gmail.com>
Authored: Wed Jun 10 13:49:13 2015 +0900
Committer: Jungtaek Lim <kabhwan@gmail.com>
Committed: Wed Jun 10 13:49:13 2015 +0900

----------------------------------------------------------------------
 .../test/clj/backtype/storm/nimbus_test.clj     | 29 ++++++++++++++++++++
 1 file changed, 29 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/12cd0988/storm-core/test/clj/backtype/storm/nimbus_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/backtype/storm/nimbus_test.clj b/storm-core/test/clj/backtype/storm/nimbus_test.clj
index f9502c2..00fb6d6 100644
--- a/storm-core/test/clj/backtype/storm/nimbus_test.clj
+++ b/storm-core/test/clj/backtype/storm/nimbus_test.clj
@@ -1180,3 +1180,32 @@
         (is (thrown-cause? InvalidTopologyException
           (submit-local-topology-with-opts nimbus "test" bad-config topology
                                            (SubmitOptions.))))))))
+
+(deftest test-stateless-with-scheduled-topology-to-be-killed
+  ; tests regression of STORM-856
+  (with-inprocess-zookeeper zk-port
+    (with-local-tmp [nimbus-dir]
+      (letlocals
+        (bind conf (merge (read-storm-config)
+                     {STORM-ZOOKEEPER-SERVERS ["localhost"]
+                      STORM-CLUSTER-MODE "local"
+                      STORM-ZOOKEEPER-PORT zk-port
+                      STORM-LOCAL-DIR nimbus-dir}))
+        (bind cluster-state (cluster/mk-storm-cluster-state conf))
+        (bind nimbus (nimbus/service-handler conf (nimbus/standalone-nimbus)))
+        (bind topology (thrift/mk-topology
+                         {"1" (thrift/mk-spout-spec (TestPlannerSpout. true) :parallelism-hint
3)}
+                         {}))
+        (submit-local-topology nimbus "t1" {TOPOLOGY-MESSAGE-TIMEOUT-SECS 30} topology)
+        ; make transition for topology t1 to be killed -> nimbus applies this event to
cluster state
+        (.killTopology nimbus "t1")
+        ; shutdown nimbus immediately to achieve nimbus doesn't handle event right now
+        (.shutdown nimbus)
+
+        ; in startup of nimbus it reads cluster state and take proper actions
+        ; in this case nimbus registers topology transition event to scheduler again
+        ; before applying STORM-856 nimbus was killed with NPE
+        (bind nimbus (nimbus/service-handler conf (nimbus/standalone-nimbus)))
+        (.shutdown nimbus)
+        (.disconnect cluster-state)
+        ))))
\ No newline at end of file


Mime
View raw message