Skip to content

Commit

Permalink
Merge pull request #193 from jgracin/issue-192
Browse files Browse the repository at this point in the history
Fix issue #192 in topics-ready? - dereferencing deferred
  • Loading branch information
Andy Chambers authored Sep 17, 2019
2 parents f3f5ea2 + 9cd9524 commit ee35332
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/jackdaw/admin.clj
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
[^AdminClient client topics]
{:pre [(client? client)
(sequential? topics)]}
(->> (describe-topics* client (map :topic-name topics))
(->> @(describe-topics* client (map :topic-name topics))
(every? (fn [[topic-name {:keys [partition-info]}]]
(every? (fn [part-info]
(and (boolean (:leader part-info))
Expand Down
6 changes: 6 additions & 0 deletions test/jackdaw/admin_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@
(is (set= [:cluster-id :controller :nodes]
(keys (admin/describe-cluster client)))))))

(deftest test-topics-ready?
(with-mock-admin-client test-cluster
(fn [client]
(admin/create-topics! client (vals test-topics))
(is (admin/topics-ready? client (vals test-topics))))))

(deftest test-partition-ids-of-topics
(with-mock-admin-client test-cluster
(fn [client]
Expand Down

0 comments on commit ee35332

Please sign in to comment.