summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/clojure/test_clojure/agents.clj8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/clojure/test_clojure/agents.clj b/test/clojure/test_clojure/agents.clj
index c0dcfd4f..b97655f8 100644
--- a/test/clojure/test_clojure/agents.clj
+++ b/test/clojure/test_clojure/agents.clj
@@ -55,6 +55,14 @@
(is (true? (instance? ArithmeticException (second @err))))
(is (thrown? RuntimeException (send agt inc)))))
+(deftest can-send-from-error-handler-before-popping-action-that-caused-error
+ (let [handler (fn [agt err]
+ (send *agent* (constantly :sent-after-error)))
+ failing-agent (agent nil :error-handler handler)]
+ (send failing-agent (fn [_] (throw (RuntimeException.))))
+ (await-for 1000 failing-agent)
+ (is (= :sent-after-error @failing-agent))))
+
(deftest restart-no-clear
(let [p (promise)
agt (agent 1 :error-mode :fail)]