lambdaisland / kaocha

Full featured next gen Clojure test runner
https://cljdoc.org/d/lambdaisland/kaocha/1.0.861/doc/1-introduction
Eclipse Public License 1.0
792 stars 81 forks source link

Sending SIGINT to `--watch` throws ClassCastException "java.io.OutputStreamWriter cannot be cast to java.io.PrintStream" #416

Closed grzm closed 1 year ago

grzm commented 1 year ago

I generally run kaocha with --watch, do some development, and when I’m done, type CTRL-C (sending SIGINT, I believe). Starting with release v1.79.1270 I’ve started to see the following stacktrace when I exit:

^CException in exit (SIGINT/ShutDown) handler
#error {
 :cause "java.io.OutputStreamWriter cannot be cast to java.io.PrintStream"
 :via
 [{:type java.lang.ClassCastException
   :message "java.io.OutputStreamWriter cannot be cast to java.io.PrintStream"
   :at [kaocha.api$run$fn__3265$fn__3269$fn__3270$on_exit__3271 invoke "api.clj" 125]}]
 :trace
 [[kaocha.api$run$fn__3265$fn__3269$fn__3270$on_exit__3271 invoke "api.clj" 125]
  [kaocha.api$run$fn__3265$fn__3269$fn__3270$fn__3273$fn__3274$fn__3275 invoke "api.clj" 141]
  [kaocha.api$run$fn__3265$fn__3269$fn__3270$fn__3273$fn__3274 invoke "api.clj" 140]
  [kaocha.api.proxy$java.lang.Object$SignalHandler$d8c00ec7 handle nil -1]
  [sun.misc.Signal$1 run "Signal.java" 212]
  [java.lang.Thread run "Thread.java" 750]]}

This doesn’t occur with the release just prior (v1.78.1249). It looks like it might be due to this commit? https://github.com/lambdaisland/kaocha/commit/09eccdbfb3eef69f1f35bfe2b421187acf78b6f7

alysbrooks commented 1 year ago

@grzm You were only having issues with Ctrl-C (SIGINT), right? The original title mentioned SIGTERM.

I actually tried out SIGTERM, and it just immediately ends. The JVM may actually handle that signal itself.

plexus commented 1 year ago

Seems this might be fixed in #417 ?