Fork me on GitHub
#cursive
<
2024-06-02
>
roklenarcic09:06:57

I think I’m getting an error due to Cursive and REPL interaction. I am running some tests and in some cases I get:

Running tests in memento.redis.listener-test
OO #object[java.util.concurrent.ConcurrentHashMap 0x55a02561 {}]
OO2 #object[java.util.concurrent.ConcurrentHashMap 0x31e2b35c {}]
PUBLISHING START  #uuid "6ed849c0-dd2f-47f5-a178-decfceb465a9"
MSG :start #uuid "6ed849c0-dd2f-47f5-a178-decfceb465a9" [[:a 1]]
Error handling response - class java.lang.ClassCastException: class clojure.lang.Symbol cannot be cast to class clojure.lang.Associative (clojure.lang.Symbol and clojure.lang.Associative are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @2eaa99)
decfceb465a9" [[:a 1]]
Error handling response - class java.lang.ClassCastException: class clojure.lang.Symbol cannot be cast to class clojure.lang.Associative (clojure.lang.Symbol and clojure.lang.Associative are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @2eaa99)
decfceb465a9" [[:a 1]]
Error handling response - class java.lang.ClassCastException: class clojure.lang.Symbol cannot be cast to class clojure.lang.Associative (clojure.lang.Symbol and clojure.lang.Associative are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @2eaa99)
decfceb465a9" [[:a 1]]
Error handling response - class java.lang.ClassCastException: class clojure.lang.Symbol cannot be cast to class clojure.lang.Associative (clojure.lang.Symbol and clojure.lang.Associative are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @2eaa99)
decfceb465a9" [[:a 1]]
Error handling response - class java.lang.ClassCastException: class clojure.lang.Symbol cannot be cast to class clojure.lang.Associative (clojure.lang.Symbol and clojure.lang.Associative are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @2eaa99)
decfceb465a9" [[:a 1]]
Error handling response - class java.lang.ClassCastException: class clojure.lang.Symbol cannot be cast to class clojure.lang.Associative (clojure.lang.Symbol and clojure.lang.Associative are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @2eaa99)
decfceb465a9" [[:a 1]]
Error handling response - class java.lang.ClassCastException: class clojure.lang.Symbol cannot be cast to class clojure.lang.Associative (clojure.lang.Symbol and clojure.lang.Associative are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @2eaa99)
decfceb465a9" [[:a 1]]
Error handling response - class java.lang.ClassCastException: class clojure.lang.Symbol cannot be cast to class clojure.lang.Associative (clojure.lang.Symbol and clojure.lang.Associative are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @2eaa99)
decfceb465a9" [[:a 1]]
Error handling response - class java.lang.ClassCastException: class clojure.lang.Symbol cannot be cast to class clojure.lang.Associative (clojure.lang.Symbol and clojure.lang.Associative are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @2eaa99)
This is all from one test run

cfleming10:06:50

Do you get a full stack trace in the log?

roklenarcic10:06:54

hm let me update the whole thing

roklenarcic10:06:57

I am running 1.13.1-2023.3

cfleming10:06:06

Ugh, yeah it looks like that exception is being swallowed.

roklenarcic10:06:22

with the new version I don’t get this exception printed anymore

cfleming10:06:54

Hmm, ok. If you’re good to go for the moment, I’ll fix that logging in the next version.

roklenarcic20:06:10

Well I see it’s still a problem. The thing is that it cuts off legitimate printouts. Here’s code for a test I run in REPL many times.

(ns memento.redis.listener3-test
  (:require [clojure.test :refer :all]
            [taoensso.carmine :as car]))

(deftest listener-subscription-test
  (testing "messages work"
    (let [p (promise)]
      (with-open [l (car/with-new-listener {}
                      (fn [[typ :as x] state]
                        (println x)
                        (when (= "message" typ)
                          (deliver p x))) {}
                      (car/subscribe "test-chan"))]
        (car/wcar {}
          (car/publish "test-chan" [1]))
        (is (= ["message" "test-chan" [1]] @p))))))
Some times I will get this kind of a printout:
Loading test/memento/redis/listener3_test.clj... done
Running tests in memento.redis.listener3-test
[subscribe test-chan 1]
[message test-chan [1]]
[carmine carmine:listener:error {:error :conn-closed, :throwable nil, :listener #taoensso.carmine.Listener{Error handling response - class java.lang.ClassCastException: class clojure.lang.Keyword cannot be cast to class clojure.lang.Associative (clojure.lang.Keyword and clojure.lang.Associative are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @4ee15653)
[carmine carmine:listener:error {:error :conn-closed, :throwable nil, :listener #taoensso.carmine.Listener{Error handling response - class java.lang.ClassCastException: class clojure.lang.Keyword cannot be cast to class clojure.lang.Associative (clojure.lang.Keyword and clojure.lang.Associative are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @4ee15653)
[carmine carmine:listener:error {:error :conn-closed, :throwable nil, :listener #taoensso.carmine.Listener{Error handling response - class java.lang.ClassCastException: class clojure.lang.Keyword cannot be cast to class clojure.lang.Associative (clojure.lang.Keyword and clojure.lang.Associative are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @4ee15653)
[carmine carmine:listener:error {:error :conn-closed, :throwable nil, :listener #taoensso.carmine.Listener{Error handling response - class java.lang.ClassCastException: class clojure.lang.Keyword cannot be cast to class clojure.lang.Associative (clojure.lang.Keyword and clojure.lang.Associative are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @4ee15653)
[carmine carmine:listener:error {:error :conn-closed, :throwable nil, :listener #taoensso.carmine.Listener{Error handling response - class java.lang.ClassCastException: class clojure.lang.Keyword cannot be cast to class clojure.lang.Associative (clojure.lang.Keyword and clojure.lang.Associative are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @4ee15653)
[carmine carmine:listener:error {:error :conn-closed, :throwable nil, :listener #taoensso.carmine.Listener{Error handling response - class java.lang.ClassCastException: class clojure.lang.Keyword cannot be cast to class clojure.lang.Associative (clojure.lang.Keyword and clojure.lang.Associative are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @4ee15653)
[carmine carmine:listener:error {:error :conn-closed, :throwable nil, :listener #taoensso.carmine.Listener{Error handling response - class java.lang.ClassCastException: class clojure.lang.Keyword cannot be cast to class clojure.lang.Associative (clojure.lang.Keyword and clojure.lang.Associative are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @4ee15653)
[carmine carmine:listener:error {:error :conn-closed, :throwable nil, :listener #taoensso.carmine.Listener{Error handling response - class java.lang.ClassCastException: class clojure.lang.Keyword cannot be cast to class clojure.lang.Associative (clojure.lang.Keyword and clojure.lang.Associative are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @4ee15653)
[carmine carmine:listener:error {:error :conn-closed, :throwable nil, :listener #taoensso.carmine.Listener{Error handling response - class java.lang.ClassCastException: class clojure.lang.Keyword cannot be cast to class clojure.lang.Associative (clojure.lang.Keyword and clojure.lang.Associative are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @4ee15653)
[carmine carmine:listener:error {:error :conn-closed, :throwable nil, :listener #taoensso.carmine.Listener{Error handling response - class java.lang.ClassCastException: class clojure.lang.Keyword cannot be cast to class clojure.lang.Associative (clojure.lang.Keyword and clojure.lang.Associative are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @4ee15653)
[carmine carmine:listener:error {:error :conn-closed, :throwable nil, :listener #taoensso.carmine.Listener{Error handling response - class java.lang.ClassCastException: class clojure.lang.Keyword cannot be cast to class clojure.lang.Associative (clojure.lang.Keyword and clojure.lang.Associative are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @4ee15653)
It cuts the print of the properties. I am not sure if just changing the logging will help, this seems to affect the app (i.e. println fails to print fully).

cfleming23:06:19

I suspect this is something to do with the async nature of the test. I’ll try to reproduce this. That test looks self-contained, right?

roklenarcic10:06:02

Some of these lines at the beginning are my println statement trying to debug this. Error handling response… lines are red