kaocha

Alys Brooks 2022-06-21T00:58:43.233599Z

New Kaocha release! This fixes a bug added to gc-profiling in the previous version: https://github.com/lambdaisland/kaocha/releases/tag/v1.68.1059

👍 2
🎉 1
dharrigan 2022-06-21T05:46:35.074419Z

Perhaps a post in #announcements and/or #releases may be useful to raise awareness too?

Alys Brooks 2022-06-21T17:59:49.963339Z

Not a bad idea. We try to release frequently, which is beneficial for existing users, but makes it less obvious when to promote a release. Maybe I'll sum up the last couple of releases.

dharrigan 2022-06-21T19:53:30.456649Z

I believe #releases are for small incremental changes, and #announcements for the bigger ones.

dharrigan 2022-06-21T19:53:55.589009Z

i.e., in #releases A place to post minor releases of libraries and projects that you would not otherwise post in #announcements

👍 1
ABeltramo 2022-06-21T11:30:48.165859Z

Thanks for taking care and fixing both issues in such a short time!

ABeltramo 2022-06-21T11:31:33.409619Z

I'm sorry to bother you guys but I keep getting errors, this one is a bit tricky to reproduce so I'm not opening an issue on Github until I figure out what's causing it

ABeltramo 2022-06-21T11:33:41.813279Z

The issue is that "sometimes" (non deterministic so it's probably tied to my particular test cases) kaocha just exit mid way returning exit code 1. The problem is that nothing is printed in the console and I don't know how to get to the underlying cause or exception.

ABeltramo 2022-06-21T11:37:05.907009Z

I quickly skimmed thru Kaocha code base and it looks like it's all running in a giant try+ catch and I'm afraid that is blocking the actual exception to bubble up. Is there any way to avoid that?

plexus 2022-06-21T12:55:55.066789Z

We only catch our own own early-exit exception in there, any "normal" exceptions will bubble, or be reported as errors depending on which stage they happen in.

plexus 2022-06-21T12:56:28.914729Z

Is it possible you're hitting some of your own code that does a System/exit?

plexus 2022-06-21T12:57:31.940459Z

If the exit code is 1 then the only way that is coming from kaocha is if there's a single failing test.

plexus 2022-06-21T12:58:46.209559Z

Have you tried reusing the random seed to reproduce the issue?

plexus 2022-06-21T12:59:12.338669Z

What does "exit mid way" mean exactly?

ABeltramo 2022-06-21T13:04:26.034009Z

> Is it possible you're hitting some of your own code that does a System/exit? It's extremely unlikely, we don't call System/exit directly anywhere and it's happening randomly at different points. > What does "exit mid way" mean exactly? I'm using the kaocha.report/documentation and I can see that (when it's stopping early) it's in a different spot everytime. > Have you tried reusing the random seed to reproduce the issue? First thing I tried, I'm always running with a set seed but the exit is not tied to any particular test case My first guess was a memory issue (and that's why I tried the gc-reporter btw) but it's happening even after increasing the heap space (via Xmx). Measuring system memory indicates that we are nowhere near the end of addressable memory.

plexus 2022-06-21T13:19:17.912779Z

It does sound a lot like something is killing your JVM...

ABeltramo 2022-06-21T13:21:59.483429Z

I know, right? I can't figure out what though and I've got no output message to work with 😓

ABeltramo 2022-06-21T13:25:02.466789Z

Maybe I should try running the tests from the REPL. Can I access the results/outputs when running it this way?

ABeltramo 2022-06-21T13:58:23.190069Z

It's happening also on the REPL when running (k/run-all) it starts running, it prints a bunch of unit tests and then it just stops running without returning the map with the results. The REPL is still running and everything is still up.

plexus 2022-06-21T14:13:01.188659Z

hmmm ok that's fascinating

plexus 2022-06-21T14:13:55.930469Z

what's the return value of run-all?

plexus 2022-06-21T14:14:48.246849Z

Can you try (kaocha.api/run (kaocha.repl/config))?

ABeltramo 2022-06-21T14:25:12.295689Z

> what's the return value of run-all? There's no return value as far as I can see, I'm back to the REPL ns waiting for an input. No message, no anything..

ABeltramo 2022-06-21T14:25:30.763339Z

Let me try: (kaocha.api/run (kaocha.repl/config))

ABeltramo 2022-06-21T14:27:18.824159Z

btw re-running run-all in the same REPL didn't triggered any error and completed fine returning the map with #:kaocha.result . This at least looks consistent with what I was seeing in the CLI.

ABeltramo 2022-06-21T14:39:26.983409Z

Same issue using api/run the output looks something like:

user=> (kaocha.api/run (kaocha.repl/config))
--- unit (clojure.test) ---------------------------
a.test
 testing something
 testing something

[.... other tests .....]

z.test
 testing something
user=>

plexus 2022-06-21T14:40:04.168469Z

a function has to either return or error... you can't not have a return value

plexus 2022-06-21T14:40:22.077359Z

how about (pr-str (kaocha.api/run (kaocha.repl/config)))?

plexus 2022-06-21T14:41:00.630199Z

are you using parallelization?

ABeltramo 2022-06-21T14:41:21.606119Z

I see what you mean, I'll try to debug it and see if I can find anything useful..

plexus 2022-06-21T14:41:45.877699Z

it's very fascinating, I must admit 😄 trying to come up with a hypothesis and failing...

😅 1
ABeltramo 2022-06-21T14:41:54.647609Z

> are you using parallelization? The tested code is highly parallel but I'm not using the parallelization from Kaocha, I'm running on the latest release..

plexus 2022-06-21T14:43:45.006849Z

you could try examing the process with jcmd/`jstack`, but without a hypothesis I'm not sure what that would yield

plexus 2022-06-21T14:43:54.206749Z

maybe also use the debug reporter

ABeltramo 2022-06-21T14:47:43.642159Z

I'll try to dig deeper into the rabbit hole as soon as I have a little bit of time. In the mean time, thank you for your help!!!

plexus 2022-06-21T15:12:25.931899Z

something else, make sure to disable output capturing. That's general advice when debugging issues, you don't want some relevant warnings or other output to get swallowed

imre 2022-06-21T15:14:44.275079Z

could also turn on kaocha debug mode

plexus 2022-06-21T15:23:34.642689Z

what's that?

imre 2022-06-21T16:25:39.520989Z

oh, that question came from an unexpected source

imre 2022-06-21T16:28:27.373339Z

And I just see you suggested that like 3 lines above

imre 2022-06-21T16:28:37.466309Z

Apologies for the noise.

plexus 2022-06-21T20:31:40.283929Z

No worries :) I was being a little facetious. I was wondering if maybe you were thinking of the debug thing we have in kaocha-cljs2.