This week, I had a bug on Chlorine. It was a simple fix, a really simple one – I just had to move two lines from a place to another: https://github.com/mauricioszabo/repl-tooling/pull/53/files.

The reason is that, on Chlorine, to connect to REPLs there are lots of intermediate steps: it first needs to await a little bit for the REPL to be ready, then detect which REPL it is (Clojure, ClojureScript, CLR, Joker, etc) then run some “prepare commands”. On some flavors (Clojure JVM is one), there are other commands that need to be run. On the case of this bug, I had to redirect the “test stdout” to the Socket REPL, but for some reason I needed to wait for response of other “prepare commands” before sending the blob to redirecting the test output.

Now, it seems like a simple fix. And indeed it is. But…. well… it broke the ClojureScript connection.

Wait, WHAT?

The thing is, it broke the CI. I thought it was a false-negative, and retried. It broke again. With the CI broken, I could not deliver (it’s a pipeline on CircleCI, thankfully), so I had to debug. And then I found out this problem.

For technical reasons, connections on ClojureScript means that Chlorine need to first connect to Clojure, then send a command. This “command” never returns (because it changes the REPL to be a ClojureScript one), and it WAS returning a nil. I’m still not sure why its happening, but it doesn’t matter.

What it does matter is that a simple fix almost broke half of Chlorine, if these tests didn’t exist. It also helped that the the deliver is a pipeline that prepares the production blob – I must confess that I was tempted to generate the production blob on my machine instead, or create a “Skip CI” hook.