# Unit test failure for 2024.2 intellij version

**URL:** <https://platform.jetbrains.com/t/unit-test-failure-for-2024-2-intellij-version/368>\
**Category:** IntelliJ Platform\
**Created:** [February 11, 2025, 10:23am UTC](https://platform.jetbrains.com/t/unit-test-failure-for-2024-2-intellij-version/368 "2025-02-11T10:23:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vaisakh\_T](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/vaisakh_t/32/2095_2.png) [@Vaisakh\_T](https://platform.jetbrains.com/u/Vaisakh_T)\
**Post date:** [February 11, 2025, 10:23am UTC](https://platform.jetbrains.com/t/unit-test-failure-for-2024-2-intellij-version/368/1 "2025-02-11T10:23:14Z")

</div>

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](https://github.com/OpenLiberty/liberty-tools-intellij/blob/main/build.gradle) file.

This is our issue number [1048](https://github.com/OpenLiberty/liberty-tools-intellij/issues/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

 ![382267746-c10e11ed-cbfc-40d6-9563-cfe21ffa60ef](https://us1.discourse-cdn.com/flex001/uploads/jetbrains_platform/original/1X/f721be009772dc3dba303b401eb689e85af94711.png)

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

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

```

---

<div class="post-metadata">

**Author:** ![Vaisakh\_T](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/vaisakh_t/32/2095_2.png) [@Vaisakh\_T](https://platform.jetbrains.com/u/Vaisakh_T)\
**Post date:** [February 11, 2025, 10:32am UTC](https://platform.jetbrains.com/t/unit-test-failure-for-2024-2-intellij-version/368/2 "2025-02-11T10:32:16Z")

</div>

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

Below is the [code](https://github.com/OpenLiberty/liberty-tools-intellij/blob/5d1f4b9b2926bd57e932ce723506eae70b5cb58a/src/test/java/io/openliberty/tools/intellij/lsp4jakarta/it/core/BaseJakartaTest.java#L80C9-L83C11) for importProjectsAsync() method that we are using in running unit tests

 ![402436395-85a56478-4cc3-4714-af05-87cfc775b08a-2](https://us1.discourse-cdn.com/flex001/uploads/jetbrains_platform/original/1X/bbe67170c9a55b3bde6a43fa5dcdc7462387669a.png)

---

<div class="post-metadata">

**Author:** ![Vaisakh\_T](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/vaisakh_t/32/2095_2.png) [@Vaisakh\_T](https://platform.jetbrains.com/u/Vaisakh_T)\
**Post date:** [February 14, 2025, 6:40am UTC](https://platform.jetbrains.com/t/unit-test-failure-for-2024-2-intellij-version/368/4 "2025-02-14T06:40:43Z")

</div>

Hi Team,

Instead of the code below

```auto
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?

---

<div class="post-metadata">

**Author:** ![abubenchikov](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/abubenchikov/32/941_2.png) [@abubenchikov](https://platform.jetbrains.com/u/abubenchikov)\
**Post date:** [March 24, 2025, 8:59am UTC](https://platform.jetbrains.com/t/unit-test-failure-for-2024-2-intellij-version/368/5 "2025-03-24T08:59:55Z")

</div>

Hi. Did I understood correclty that you use java to call kotlin suspend functions? Did you try to migrate your test code to kotlin?
