Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mbs 12612 Kotlin fallback fixes #1336

Merged
merged 2 commits into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ internal class PreventKotlinDaemonFallbackTest {
.outputContains("Could not connect to kotlin daemon. Using fallback strategy.")
}

@Test
fun `disabled check without daemon strategy - no fallback strategy`() {
generateProject(enableCheck = false)
val result = build(":lib1:compileKotlin", "-Dkotlin.compiler.execution.strategy=in-process")

result.assertThat()
.buildSuccessful()
.outputDoesNotContain("Could not connect to kotlin daemon. Using fallback strategy.")
}

@Test
fun `single fallback - success`() {
generateProject(enableCheck = true)
Expand Down Expand Up @@ -68,11 +78,11 @@ internal class PreventKotlinDaemonFallbackTest {
}

private fun build(
task: String,
vararg args: String,
expectFailure: Boolean = false
) = gradlew(
projectDir,
task,
*args,
"-Dkotlin.daemon.jvm.options=invalid_jvm_argument_to_fail_process_startup",
"--rerun-tasks",
expectFailure = expectFailure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ internal class KotlinDaemonFallbackDetector {

fun register(project: Project) {
if (isDaemonDisabled(project)) {
project.logger.debug("Kotlin daemon fallback detection is disabled due to absence of daemon")
project.logger.lifecycle("Kotlin daemon fallback detection is disabled due to absence of daemon")
return
}
val fallbacksCounter = AtomicInteger(0)
Expand Down