IC2 freezing IntelliJ IDEA at the start of test runs with DX projects

Issue #929 resolved
E.J. Wilburn created an issue

Seemingly at random when starting a test run IDEA will freeze completely and has to be killed. It happens after the test runner opens and starts displaying the test that will be run but I believe the freeze happens before the "checking DX connections" pop-up window is usually displayed. The crash logs show that test runner threads are blocked.

Comments (9)

  1. Scott Wells repo owner

    Thanks for sending the logs and thread dumps. I'll look at those and also try to reproduce. Is this is recent change in behavior? Do you know if perhaps it started with a recent build of IC and/or IntelliJ (they issued an update this week as well)? It would be good to know if the behavior can be correlated with some specific change.

    Anyway, I'll look into and see what I can do to address it. Thanks for filing!

  2. E.J. Wilburn reporter

    I just started converting my stuff to DX a couple of days ago so unfortunately I don't know if it was occurring earlier. According to my IDEA logs I was using the same versions of IC2 and IDEA when I started using DX.

  3. Jaap Branderhorst Account Deactivated

    Hi @RoseSilverSoftware This has been going on for quite a while. Actually it's something that happens to me every morning I start working on a project. My guess is that Illuminated tries to login into the scratch org using an old access token and doesn't refresh the access token.

    How to replay: - Open IntelliJ/Illuminated Cloud - Load a project and ensure you have pushed something to a scratch org or have ran some tests just to ensure IntelliJ/Illuminated works - Wait a couple of hours (a night will work for sure) - Start a test - IntelliJ hangs. Only a force quit (on mac) works.

  4. Scott Wells repo owner

    Okay, that helps. I have a sneaking suspicion that I know what's going on and will do some testing/verification myself, but can you guys who are experiencing this do me a favor and enable debug logging for SFDX and unit test execution as documented here:

    http://www.illuminatedcloud.com/support/debuglogging

    so that the next time it happens, you can attach a log showing EXACTLY what led to the freeze?

    My suspicion, for what it's worth, is that right now the CLI emits non-JSON text before the JSON output saying that a CLI update is available. This has been reported to Salesforce by several tooling partners, though it seems to be coming from the underlying Heroku CLI framework rather than the SFDX CLI proper, so they're researching the best way to suppress that when run with the --json flag for purposes of integration. I'm betting that unexpected portion of the output is causing IC to go a bit sideways when (as Jaap surmised) it's getting a fresh access token. A log would show me definitively that's what's happening.

  5. E.J. Wilburn reporter

    I've enabled the debug log though no further freezes have happened yet.

    I looked at the logs from all 3 freezes I've had and all have a blocked thread calling getConnectionConfig:

    at com.illuminatedcloud.intellij.runconfig.AbstractApexProcessHandler.getConnectionConfig(SourceFile:72)

    Here are the related points in the main log as well and the last line before all of them is:

    2018-03-14 00:18:31,606 [ 584672] INFO - luminatedCloudConnectionConfig - Retrieving org list from sfdx CLI.

    If it was an issue with the CLI needing to be upgraded wouldn't be more reliably reproducible or continue to happen until I upgraded the CLI? I was using the CLI directly quite frequently and didn't notice any upgrade message. I had just installed it 2 days before and upgraded at that time.

  6. Scott Wells repo owner

    E.J., you're correct. Thanks to the provided thread dumps I can see the issue now. It's a thread deadlock, though not a traditional one. I just implemented a fix that will be included in the next build. Thanks for providing the details!

  7. Scott Wells repo owner

    Prospective fix delivered in 1.8.2.2 and 2.0.1.3. Please feel free to reopen with new logs if you see the problem occur after updating.

  8. Log in to comment