Test reporter can't handle interrupted test
Expected behavior
When interrupting the following test case with M-x cider-interrupt:
(deftest test-interrupt
(while true))
I see the following stacktrace in the REPL buffer:
Exception in thread "nREPL-session-f0ebf9b1-a964-4c8e-95bd-201dbe208f32" java.lang.IllegalArgumentException: no conversion to symbol
at clojure.core$symbol.invokeStatic(core.clj:598)
at clojure.core$symbol.invoke(core.clj:591)
at cider.nrepl.middleware.test$report_fixture_error.invokeStatic(test.clj:269)
at cider.nrepl.middleware.test$report_fixture_error.invoke(test.clj:258)
at cider.nrepl.middleware.test$test_vars.invokeStatic(test.clj:348)
at cider.nrepl.middleware.test$test_vars.invoke(test.clj:324)
at cider.nrepl.middleware.test$test_ns.invokeStatic(test.clj:364)
at cider.nrepl.middleware.test$test_ns.invoke(test.clj:350)
at cider.nrepl.middleware.test$test_var_query$fn__12659.invoke(test.clj:383)
Actual behavior
I would expect to see a "Evaluation interrupted" message or something similar and the test reporter to not crash.
Steps to reproduce the problem
- Move point over the test case
- Run
M-x cider-test-run-testto start the test - Run
M-x cider-interruptto interrupt the test - Take a look at the REPL buffer to see the stacktrace
Environment & Version information
Linux precision 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 GNU/Linux
CIDER version information
;; CIDER 1.13.1 (Santiago), nREPL 1.0.0
;; Clojure 1.11.1, Java 1.8.0_402
The same happens with nREPL 1.2.0-beta1 which I tried initially.
Lein / Clojure CLI version
Leiningen 2.10.0 on Java 1.8.0_402 OpenJDK 64-Bit Server VM
Emacs version
29.3
Operating system
Ubuntu 22.04.4 LTS
JDK distribution
openjdk version "1.8.0_402" OpenJDK Runtime Environment (build 1.8.0_402-8u402-ga-2ubuntu1~22.04-b06) OpenJDK 64-Bit Server VM (build 25.402-b06, mixed mode)
By the way, it works correctly if the interrupted code is wrapped in is.
(deftest test-interrupt
(is (while true)))
Oh, interesting. That's what I actually wanted to test. :) Still room for improvement.
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed soon if no further activity occurs. Thank you for your contribution and understanding!
Yeah, this can be better. It also reminded me to remove exclude the confirmed bugs from the issue staleness checks.