Fork me on GitHub
#cursive
<
2024-01-22
>
favila15:01:28

I have a really large test namespace that takes tens of seconds to run. If I use the “run tests in current ns in repl” action and then edit code in that namespace while the tests are running (test markers are being placed), very often the IDEA ui will completely deadlock when the test run is finished, requiring me to force-quit Intellij. Has anyone else experienced this? Using MacOS Ventura 13.6.3 with Cursive 1.13.1 with IDEA 2023.3.2, but experienced this on previous versions of both.

Sam Adams16:01:46

I run into this very often, also on Mac / with as many cursive versions as I can remember. It is quite a pain point. Would be happy to try and reproduce / collect more information if helpful.

cfleming21:01:57

When the UI deadlocks, IntelliJ should produce automatic thread dumps (see https://intellij-support.jetbrains.com/hc/en-us/articles/206544899-Getting-a-thread-dump-when-IDE-hangs-and-doesn-t-respond). If one of you could send me some of them I’ll take a look. Probably <mailto:[email protected]|[email protected]> is best.

Sam Adams23:01:48

Thanks Colin - I sent a thread dump to that email.

favila23:01:24

I’ll send one too in a moment--thanks for reminding me

favila23:01:02

I was wrong, the ui can freeze before the tests finish running.

favila23:01:11

threadumps sent; thanks in advance!

favila23:01:37

BTW I tried with edits that do not involve newlines (so line numbers don’t change) and it didn’t freeze. But even the simplest newline insertion (between two top-level forms) froze nearly immediately. So that is perhaps a clue.

cfleming23:01:38

Thanks for that, I’ll take a look at both. It seems like this might be https://github.com/cursive-ide/cursive/issues/2752.

cfleming23:01:04

Thanks for those dumps. I believe I can see the cause of the problem, I think it’s not taking the appropriate read lock before performing the search for the element in the AST relating to the test result. This seems to cause a deadlock, but it must be sporadically since I’ve never seen it myself. However, I’m pretty sure I know what the fix is.

🙌 1
cfleming00:01:53

Actually, I spoke too quickly - I actually am taking the appropriate lock. I’ll continue investigating.