This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-12
Channels
- # announcements (3)
- # babashka (6)
- # beginners (84)
- # biff (1)
- # cider (7)
- # cljsrn (1)
- # clojure (18)
- # clojure-australia (3)
- # clojure-dev (21)
- # clojure-france (1)
- # clojure-spec (6)
- # clojurescript (78)
- # datomic (34)
- # emacs (5)
- # exercism (32)
- # graalvm (1)
- # helix (2)
- # hyperfiddle (3)
- # lsp (36)
- # malli (4)
- # missionary (3)
- # off-topic (54)
- # re-frame (14)
- # releases (2)
- # sql (31)
- # vim (9)
Does anyone know why spec/check
seems to take forever to cleanup? In the following minimally reproducible example, Clojure takes ~60 seconds to shutdown after "Done" is printed, but exits immediately if the check
call is removed:
(ns test
(:require [clojure.spec.alpha :as spec]
[clojure.spec.test.alpha :as spec-test]))
(spec/def ::number number?)
(spec/fdef plus
:args (spec/or
:nothing (spec/cat)
:numbers (spec/* ::number))
:ret (spec/or
:number ::number))
(defn plus [& values]
(apply + values))
(defn -main [& args]
(spec-test/check `plus)
(println "Done"))
@edahlseng There's probably a thread pool that it is waiting on. Call (shutdown-agents)
in -main
to solve that.
See the FAQ for Clojure https://clojure.org/guides/faq#agent_shutdown
@seancorfield, that works wonderfully! I wasn't aware of (shutdown-agents)
, thanks for the tip!
There's lots of good stuff in the FAQ.
There definitely is. I've ended up there through some Google searches, but haven't given it a direct read through otherwise. Looks like I should do that now to preempt future questions!