Unit test failure for 2024.2 intellij version

After making changes in build.gradle file for supporting intellij 2024.2. When running the unit test for intellij 2024.2. The build is neither getting failed nor terminated for a long time. The termination takes more than 10 minutes. The same tests works fine for intellij 2024.1 version.

This is our build.gradle file.

This is our issue number 1048 opened in our repo Liberty Tools Intellij. You can obtain the build failure logs from the issue description. The logs are collected after the tests have been terminated.

Upon investigation we found that the test fails when it reaches this method

The failure pointed to above specific line of code located in the BaseJakartaTest class, which extends the MavenImportingTestCase class. The line invokes the method importProjectsAsync(pomFiles.toArray(VirtualFile[]::new), continuation) , which is defined in the MavenImportingTestCase class.

As I shared the screenshot below, there are two additional parameters present in the code built using version 2024.2 compared to the code built using version 2024.1. We are calling importProjectsAsync method in BaseJakartaTest` class which is responsible for running the unit tests.

With the modification of importProjectsAsync in 2024.2, which now includes SimpleStructureProjectVisitor(), we are encountering a deadlock when invoking this function from Java using BuildersKt.runBlocking.

We assume , the issue appears to have originated from IntelliJ’s side, likely due to changes in indexing behavior after the modification that introduced SimpleStructureProjectVisitor(). The deadlock occurs when calling importProjectsAsync from Java using BuildersKt.runBlocking, as the function waits on IndexingTestUtil.suspendUntilIndexesAreReady, which in turn requires coroutine execution but gets blocked. This was not an issue before the IntelliJ modification, suggesting that recent indexing changes may have affected coroutine execution.

We currently using below versions

plugins {
    id 'java'
    id 'org.jetbrains.intellij.platform' version '2.2.1'
    id 'org.jetbrains.kotlin.jvm' version '2.1.10'
}

There are two additional parameters present in the code built using version 2024.2 compared to the version 2024.1.

Below is the code for importProjectsAsync() method that we are using in running unit tests

Hi Team,

Instead of the code below

BuildersKt.runBlocking(
                EmptyCoroutineContext.INSTANCE,
                (scope, continuation) -> importProjectsAsync(pomFiles.toArray(VirtualFile[]::new), continuation)
        );

I tried this code: importProjectsWithErrors(pomFiles.toArray(VirtualFile[]::new));, and the unit tests started running, but 5 tests failed due to an assertion failure. I tested the same code in IntelliJ 2024.1, and all the tests passed. However, with the code built using IntelliJ version 2024.2, five tests are now failing.

So my question is: can we use this code, importProjectsWithErrors(pomFiles.toArray(VirtualFile[]::new));, instead of the previous one, and What’s the reason for the five test failures due to the update of only the IntelliJ version?