diff --git a/compiler/fir/modularized-tests/tests/org/jetbrains/kotlin/fir/FirResolveModularizedTotalKotlinTest.kt b/compiler/fir/modularized-tests/tests/org/jetbrains/kotlin/fir/FirResolveModularizedTotalKotlinTest.kt index 1e2d9dfad2c..5e5cfe364ea 100644 --- a/compiler/fir/modularized-tests/tests/org/jetbrains/kotlin/fir/FirResolveModularizedTotalKotlinTest.kt +++ b/compiler/fir/modularized-tests/tests/org/jetbrains/kotlin/fir/FirResolveModularizedTotalKotlinTest.kt @@ -56,18 +56,22 @@ class FirResolveModularizedTotalKotlinTest : AbstractModularizedTest() { private var bestStatistics: FirResolveBench.TotalStatistics? = null private var bestPass: Int = 0 - private val asyncProfiler = try { - if (ASYNC_PROFILER_LIB != null) { + private val asyncProfiler = if (ASYNC_PROFILER_LIB != null) { + try { AsyncProfilerHelper.getInstance(ASYNC_PROFILER_LIB) - } else { - null + } catch (e: ExceptionInInitializerError) { + if (e.cause is ClassNotFoundException) { + throw IllegalStateException("Async-profiler initialization error, make sure async-profiler.jar is on classpath", e.cause) + } + throw e } - } catch (_: Throwable) { + } else { null } - private fun executeAsyncProfilerCommand(command: String, pass: Int) { + private fun executeAsyncProfilerCommand(command: String?, pass: Int) { if (asyncProfiler != null) { + require(command != null) fun String.replaceParams(): String = this.replace("\$REPORT_DATE", reportDateStr) .replace("\$PASS", pass.toString())