Skip to content

Commit

Permalink
Merge 8716a1d into 4616e81
Browse files Browse the repository at this point in the history
  • Loading branch information
msbond committed Jun 4, 2019
2 parents 4616e81 + 8716a1d commit 1aabb70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/ziggurat/init.clj
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@
(defn stop
"Calls the Ziggurat's state stop fns and then actor-stop-fn."
[actor-stop-fn modes]
(actor-stop-fn)
(stop-common-states)
(execute-function modes :stop-fn)
(actor-stop-fn))
(execute-function modes :stop-fn))

(defn- add-shutdown-hook [actor-stop-fn modes]
(.addShutdownHook
Expand Down
6 changes: 3 additions & 3 deletions test/ziggurat/init_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
(is (= 16 @result))))))

(deftest stop-calls-actor-stop-fn-test
(testing "The actor stop fn stops after the ziggurat state"
(testing "The actor stop fn stops before the ziggurat state"
(let [result (atom 1)]
(with-redefs [streams/start-streams (constantly nil)
streams/stop-streams (fn [_] (reset! result (* @result 2)))
config/config-file "config.test.edn"]
(init/start #() {} [] nil)
(init/stop #(reset! result (+ @result 3)) nil)
(is (= 5 @result))))))
(is (= 8 @result))))))

(deftest stop-calls-idempotentcy-test
(testing "The stop function should be idempotent"
Expand All @@ -39,7 +39,7 @@
config/config-file "config.test.edn"]
(init/start #() {} [] nil)
(init/stop #(reset! result (+ @result 3)) nil)
(is (= 5 @result))))))
(is (= 8 @result))))))

(deftest start-calls-make-queues-test
(testing "Start calls make queues"
Expand Down

0 comments on commit 1aabb70

Please sign in to comment.