Can not run unit tests in android project because of deadlocked gradle task

I wanted to add some tests to android project, but then got stuck with frozen process. I have no idea why this freeze happens but looking in more details it is compileUnitTestsKotlin task, which if solely run in debug mode has log messages as can be seen below; as far as I understand, some deadlocking happens but I am not sure what is the main issue and how it can be resolved

2022-03-03T23:46:21.953+0300 [DEBUG] [sun.rmi.transport.tcp] RMI RenewClean-[127.0.0.1:17154,org.jetbrains.kotlin.daemon.common.LoopbackNetworkInterface$ClientLoopbackSocketFactory@600c1c6f]: reuse connection
2022-03-03T23:46:21.954+0300 [DEBUG] [sun.rmi.transport.tcp] RMI RenewClean-[127.0.0.1:17154,org.jetbrains.kotlin.daemon.common.LoopbackNetworkInterface$ClientLoopbackSocketFactory@600c1c6f]: create reaper
2022-03-03T23:46:21.988+0300 [DEBUG] [sun.rmi.transport.tcp] RMI TCP Connection(35)-127.0.0.1: accepted socket from [127.0.0.1:62994]
2022-03-03T23:46:21.988+0300 [DEBUG] [sun.rmi.transport.tcp] RMI TCP Connection(35)-127.0.0.1: (port 62675) op = 80
2022-03-03T23:46:21.989+0300 [DEBUG] [sun.rmi.loader] RMI TCP Connection(35)-127.0.0.1: name = “[Ljava.rmi.server.ObjID;”, codebase = “”, defaultLoader = jdk.internal.loader.ClassLoaders$PlatformClassLoader@4f6b541f
2022-03-03T23:46:21.989+0300 [DEBUG] [sun.rmi.loader] RMI TCP Connection(35)-127.0.0.1: name = “java.rmi.dgc.Lease”, codebase = “”, defaultLoader = jdk.internal.loader.ClassLoaders$PlatformClassLoader@4f6b541f
2022-03-03T23:46:21.989+0300 [DEBUG] [sun.rmi.loader] RMI TCP Connection(35)-127.0.0.1: name = “java.rmi.dgc.VMID”, codebase = “”, defaultLoader = jdk.internal.loader.ClassLoaders$PlatformClassLoader@4f6b541f
2022-03-03T23:46:21.989+0300 [DEBUG] [sun.rmi.loader] RMI TCP Connection(35)-127.0.0.1: name = “[B”, codebase = “”, defaultLoader = jdk.internal.loader.ClassLoaders$PlatformClassLoader@4f6b541f 2022-03-03T23:46:21.989+0300 [DEBUG] [sun.rmi.loader] RMI TCP Connection(35)-127.0.0.1: name = “java.rmi.server.UID”, codebase = “”, defaultLoader = jdk.internal.loader.ClassLoaders$PlatformClassLoader@4f6b541f
2022-03-03T23:46:25.048+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2022-03-03T23:46:25.048+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2022-03-03T23:46:25.048+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2022-03-03T23:46:25.048+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2022-03-03T23:46:25.049+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2022-03-03T23:46:25.049+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2022-03-03T23:46:35.049+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2022-03-03T23:46:35.049+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2022-03-03T23:46:35.049+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2022-03-03T23:46:35.049+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2022-03-03T23:46:35.049+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2022-03-03T23:46:35.050+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2022-03-03T23:46:35.193+0300 [DEBUG] [sun.rmi.transport.tcp] RMI Scheduler(0): close connection
2022-03-03T23:46:35.242+0300 [DEBUG] [sun.rmi.transport.tcp] RMI TCP Connection(34)-127.0.0.1: (port 62675) connection closed
2022-03-03T23:46:35.242+0300 [DEBUG] [sun.rmi.transport.tcp] RMI TCP Connection(34)-127.0.0.1: close connection
2022-03-03T23:46:36.958+0300 [DEBUG] [sun.rmi.transport.tcp] RMI Scheduler(0): close connection
2022-03-03T23:46:36.993+0300 [DEBUG] [sun.rmi.transport.tcp] RMI TCP Connection(35)-127.0.0.1: (port 62675) connection closed
2022-03-03T23:46:36.993+0300 [DEBUG] [sun.rmi.transport.tcp] RMI TCP Connection(35)-127.0.0.1: close connection
2022-03-03T23:46:45.046+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2022-03-03T23:46:45.046+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2022-03-03T23:46:45.046+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2022-03-03T23:46:45.046+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2022-03-03T23:46:45.046+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2022-03-03T23:46:45.046+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2022-03-03T23:46:55.049+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2022-03-03T23:46:55.049+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2022-03-03T23:46:55.049+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2022-03-03T23:46:55.049+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2022-03-03T23:46:55.049+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2022-03-03T23:46:55.049+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2022-03-03T23:47:05.048+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2022-03-03T23:47:05.049+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2022-03-03T23:47:05.049+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2022-03-03T23:47:05.049+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2022-03-03T23:47:05.049+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2022-03-03T23:47:05.049+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2022-03-03T23:47:15.045+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2022-03-03T23:47:15.045+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2022-03-03T23:47:15.045+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2022-03-03T23:47:15.046+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2022-03-03T23:47:15.046+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2022-03-03T23:47:15.046+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2022-03-03T23:47:25.048+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2022-03-03T23:47:25.048+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2022-03-03T23:47:25.048+0300 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.