kaocha

Official support channel: https://clojureverse.org/c/projects/kaocha
Helins 2020-11-04T08:30:52.036400Z

After coming back to a project, I am now systematically hitting a "Exception: clojure.lang.ExceptionInfo: Kaocha ClojureScript client failed connecting back." on node. I tried upgrading deps (Kaocha version remained unchanged), flushing everything and reinstalling.

Helins 2020-11-04T08:35:03.036700Z

I expect it to be somehow my fault, any idea?

plexus 2020-11-04T08:52:44.037500Z

that really doesn't say anything @adam678, there are an infinite number of reasons why you might be getting that error. Follow the instructions in the kaocha-cljs README for getting debug information.

Helins 2020-11-04T09:00:45.039Z

@plexus Yes, although I don't find it particularly useful in this case (maybe I should):

[TypeError: Cannot read property 'error__GT_str' of undefined
    at Socket.<anonymous> ([stdin]:89:28)
    at Socket.emit (events.js:315:20)
    at Socket.emit (domain.js:482:12)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:267:11)
    at Socket.push (_stream_readable.js:212:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
    at Domain.<anonymous> ([stdin]:50:21)
    at Domain.emit (events.js:315:20)
    at Domain.emit (domain.js:482:12)

E]
Randomized with --seed 1747909567

ERROR in node (main.java:40)
Unexpected error executing kaocha-cljs test suite.
Exception: clojure.lang.ExceptionInfo: Kaocha ClojureScript client failed connecting back.
{:kaocha.testable/id :node, :cljs/repl-env cljs.repl.node/repl-env, :cljs/compiler-options {:target :nodejs}}
 at kaocha.type.cljs$eval6800$fn__6802$fn__6816.invoke (cljs.clj:280)
    kaocha.type.cljs$queue_consumer.invokeStatic (cljs.clj:181)
    kaocha.type.cljs$queue_consumer.invoke (cljs.clj:173)
    kaocha.type.cljs$eval6800$fn__6802.invoke (cljs.clj:258)
    ...
    kaocha.testable$run.invokeStatic (testable.clj:119)
    kaocha.testable$run.invoke (testable.clj:110)
    ...
    kaocha.testable$run_testable.invokeStatic (testable.clj:199)
    kaocha.testable$run_testable.invoke (testable.clj:148)
    kaocha.testable$run_testables.invokeStatic (testable.clj:212)
    kaocha.testable$run_testables.invoke (testable.clj:202)
    kaocha.api$run$fn__3072$fn__3073$fn__3074.invoke (api.clj:106)
    ...
    kaocha.api$run$fn__3072$fn__3073.invoke (api.clj:98)
    ...
    kaocha.api$run$fn__3072.invoke (api.clj:97)
    ...
    kaocha.api$run.invokeStatic (api.clj:83)
    kaocha.api$run.invoke (api.clj:71)
    kaocha.runner$run.invokeStatic (runner.clj:129)
    kaocha.runner$run.invoke (runner.clj:71)
    kaocha.runner$_main_STAR_.invokeStatic (runner.clj:162)
    kaocha.runner$_main_STAR_.doInvoke (runner.clj:141)
    ...
    kaocha.runner$_main.invokeStatic (runner.clj:173)
    kaocha.runner$_main.doInvoke (runner.clj:171)
    ...
0 tests, 1 assertions, 1 errors, 0 failures.

plexus 2020-11-04T09:02:35.039400Z

what's your clojurescript version? error->str is a relatively new addition

Helins 2020-11-04T09:12:41.039800Z

It seems shadow-cljs pulls in version 1.10.773

plexus 2020-11-04T09:30:28.040Z

kaocha-cljs is not compatible with shadow

Helins 2020-11-04T12:08:29.043Z

Then I am really confused. It was working before (but cannot really figure out what happened since then), the browser target still does, and going to a commit before shadow was added still results in the exact same error (CLJS being pulled directly by kaocha-cljs). Could it rather be something with node itself? Although I am fairly sure I didn't upgrade since the last time it worked.

plexus 2020-11-04T14:20:02.045300Z

it's hard to say... we rely on the node repl-env that ships with clojurescript to launch node. then we use that repl-env to load some kaocha code which connects back to us via a websocket, so that it can forward cljs.test messages. Something in that process is not working, and I can't tell you what it it. All we know is that we ask the node cljs-repl to boot up and evaluate some code, and then expect it to connect back to us, but somehow it doesn't.

plexus 2020-11-04T14:23:19.047800Z

there is a whole sequence of the things happening under the hood that we have little to no control over or insight into, I can not tell you which one of these is going wrong: - starting the node executable - loading the repl bootstrap code which hooks into node's output printing - compiling our websocket-client code - loading/running the websocket-client code into node - connecting the websocket from node to kaocha

plexus 2020-11-04T14:25:16.049400Z

since you're on shadow-cljs the best I can offer is upgrading to kaocha-cljs2, but prepare for a learning curve and more figuring stuff out. The bulk of the work for kaocha-cljs2 is done, but the step of actually polishing it up, documented it, and creating ready-to-use recipes has not happened. I've been completely swamped with other stuff.

Helins 2020-11-04T16:44:01.051400Z

All right, must be something somewhere in the env but hell knows what. I'll let you know if I happen to find a solution. Anyways, thanks for your time. Both for today and in general, for all your high quality open-source work which is so useful to the community! Times are hard and I guess you are indeed busy.