cider 2025-11-18

all of my tests are returning this thing as error

can you verify how your tests behave outside of CIDER?

clj
(require 'some-test.ns 'clojure.test)
(clojure.test/run-tests 'some-test.ns)

Hi! This is probably the result of recent nREPL changes. Can you check which versions of nrepl and cider-nrepl you have on classpath? M-x cider-classpath

> can you verify how your tests behave outside of CIDER? The tests behave well

/Users/ian.santos/.m2/repository/cider/cider-nrepl/0.47.1/cider-nrepl-0.47.1.jar

/Users/ian.santos/.m2/repository/nrepl/nrepl/1.5.1/nrepl-1.5.1.jar

nREPL is latest but cider-nrepl is more than a year old. Could you upgrade to the latest version and please try again?

forgot how to upgrade cider, how to do it?

/opt/homebrew/bin/clojure -Sdeps \{\:deps\ \{nrepl/nrepl\ \{\:mvn/version\ \"1.5.1\"\}\ cider/cider-nrepl\ \{\:mvn/version\ \"0.58.0\"\}\}\ \:aliases\ \{\:cider/nrepl\ \{\:main-opts\ \[\"-m\"\ \"nrepl.cmdline\"\ \"--middleware\"\ \"\[cider.nrepl/cider-middleware\]\"\]\}\}\} -M:dev:repl:cider/nrepl

OK, so when you jack in, the correct version is supplied, but you probably have an alias that contains the old version in ~/.clojure/deps.edn or in the deps.edn of the project itself.

it's always inside the global deps.edn

cause the jack-in command is giving me that

ok, it was the project that was getting a older vx

but same error is happening

Alright. Thanks for upgrading still, it is useful to know you run the latest code before investigating

Could you please try this in any other project? I mean running the tests

my-test-namespace> (my-51-test)

ERROR in (my-51-test) (UTF_8.java:81)
Uncaught exception, not in assertion.
expected: nil
  actual: java.lang.StackOverflowError: null
 at sun.nio.cs.UTF_8.updatePositions (UTF_8.java:81)
    sun.nio.cs.UTF_8$Encoder.encodeArrayLoop (UTF_8.java:462)
    sun.nio.cs.UTF_8$Encoder.encodeLoop (UTF_8.java:563)
    java.nio.charset.CharsetEncoder.encode (CharsetEncoder.java:587)
    sun.nio.cs.StreamEncoder.implWrite (StreamEncoder.java:280)
    sun.nio.cs.StreamEncoder.implWrite (StreamEncoder.java:267)
    sun.nio.cs.StreamEncoder.write (StreamEncoder.java:122)
   java.io.OutputStreamWriter.write (OutputStreamWriter.java:206)
    java.io.BufferedWriter.flushBuffer (BufferedWriter.java:168)
    java.io.BufferedWriter.flush (BufferedWriter.java:305)
    cider.nrepl.middleware.out$print_stream$fn__6852.invoke (out.clj:147)
    cider.nrepl.middleware.out.proxy$java.io.OutputStream$ff19274a.flush (:-1)
    java.io.PrintStream.flush (PrintStream.java:406)
    sun.nio.cs.StreamEncoder.implFlush (StreamEncoder.java:321)
    sun.nio.cs.StreamEncoder.flush (StreamEncoder.java:150)swipe-

> Could you please try this in any other project? I mean running the tests did, same error

What is (my-51-test) exactly?

Let's try another thing, just in case. Downgrade nrepl itself to 1.4.0 by doing M-x customize-variable cider-injected-nrepl-version and set it to 1.4.0 there, click Apply. Then, relaunch the project, verify that it is indeed 1.4.0 on cider-classpath , and then run your tests.

So, this happens on some small unrelated project too? Could you possibly make a reproducer?

ah in smaller project worked

What exactly do you do, I still don't quite get. Do you run tests with C-c C-t C-n, or do you call something like clojure.test/run-tests from the REPL?

in REPL in cursive I can run the tests

Can you double-check in cider-classpath that you really get the cider-nrepl 0.58.0 in the project where it fails?

Actually, this rings a bell. I think we have a submitted issue for this

the problem then it seems my logger env too

Yeah, interaction between nested System/out wrappers

I have a configured log with unilog

> Yeah, interaction between nested System/out wrappers makes sense

Try M-x customize-variable cider-redirect-server-output-to-repl and turn it off

Then relaunch the REPL and try the tests

this was the problem then

Yeah, you are welcome. This should be a stable workaround until I finally get to this. If you need the forwarding behavior in other projects, you can only disable it for this project via .dir-locals.el (https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html)

👍 1

what should I do to fix this behavior to have test-runner in cider? Answer: > M-x customize-variable cider-redirect-server-output-to-repl