Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Commit

Permalink
test stop-pipeline-runner instead of sending on the event-bus (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
flosell committed Apr 3, 2016
1 parent aa4de83 commit e381096
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/clj/lambdacd/internal/pipeline_state_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
(update [_ _ _ _]
(throw (Exception. "no update expected"))))
updater-finished-ch (start-pipeline-state-updater pipeline-state ctx)]
(event-bus/publish ctx :stop-pipeline-state-updater {})
(tu/call-with-timeout 1000 (stop-pipeline-state-updater ctx updater-finished-ch))
(is (not= {:status :timeout} (tu/get-or-timeout updater-finished-ch :timeout 1000))))))
3 changes: 3 additions & 0 deletions test/clj/lambdacd/testsupport/test_util.clj
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@
`(async/go
~body))

(defmacro call-with-timeout [timeout body]
`(get-or-timeout (start-waiting-for ~body) :timeout ~timeout))

(defn start-waiting-for-result [key-to-wait-for result-channel]
(async/go-loop []
(let [[key value] (async/<! result-channel)]
Expand Down

0 comments on commit e381096

Please sign in to comment.