Fork me on GitHub
#kaocha
<
2020-11-04
>
Helins08:11:52

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.

Helins08:11:03

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

plexus08:11:44

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.

Helins09:11:45

@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.

plexus09:11:35

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

Helins09:11:41

It seems shadow-cljs pulls in version 1.10.773

plexus09:11:28

kaocha-cljs is not compatible with shadow

Helins12:11:29

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.

plexus14:11:02

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.

plexus14:11:19

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

plexus14:11:16

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.

Helins16:11:01

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.