clojure-emacs / cider

The Clojure Interactive Development Environment that Rocks for Emacs
https://cider.mx
GNU General Public License v3.0
3.52k stars 642 forks source link

Test reporter can't handle interrupted test #3677

Open r0man opened 1 month ago

r0man commented 1 month ago

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

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)

alexander-yakushev commented 1 month ago

By the way, it works correctly if the interrupted code is wrapped in is.

(deftest test-interrupt
  (is (while true)))
image
r0man commented 1 month ago

Oh, interesting. That's what I actually wanted to test. :) Still room for improvement.