Make test task for kotlin incremental in Gradle?

I would like to make my test task incremental, but I noticed that it looks for files in java instead of kotlin:

Task ':test' is not up-to-date because:
  Task.upToDateWhen is false.
file or directory '/path/to/my/project/build/classes/java/test', not found

I have the following plugins enabled:

plugins {
    kotlin("jvm") version "1.6.20"
    kotlin("plugin.spring") version "1.6.20"

How I can configure test task to pick up /path/to/my/project/build/classes/kotlin/test
instead of java?

It looks like IDEA bug - IDEA-240111