[tests] Isolate parallel Kotlin Gradle state#12217
Open
jonathanpeppers wants to merge 1 commit into
Open
Conversation
Keep each importing Java.Interop test project build directory and Gradle project cache under its own obj directory so parallel solution builds cannot corrupt compiler snapshots or plugin configuration state. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0798499d-b183-4bbe-b627-d404fa5a5455
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses intermittent failures when the Kotlin/Gradle test fixture is built concurrently by multiple Java.Interop test projects, by isolating remaining shared Gradle mutable state (build directory + project cache) per importing project under obj/.
Changes:
- Configure the Kotlin Gradle fixture to honor an externally supplied build directory via
kotlinBuildDir. - Update the MSBuild
Execinvocation to pass per-project--project-cache-dirand-PkotlinBuildDir=...paths under each project’s intermediate output directory. - Expand the target documentation to explain why build + project cache isolation is required in addition to
GRADLE_USER_HOME.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| external/Java.Interop/tests/Xamarin.Android.Tools.Bytecode-Tests/kotlin-gradle/build.gradle.kts | Sets Gradle build output location from an MSBuild-provided property to avoid shared build state. |
| external/Java.Interop/tests/Xamarin.Android.Tools.Bytecode-Tests/kotlin-gradle.targets | Routes Gradle project cache + build directories into each project’s obj/ to fully isolate parallel builds. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
title and
description
should follow the
commit-messages.mdworkflow documentation, and in particular should include:Description
Java.Interop solution builds run the Kotlin fixture from two test projects in parallel. Although their Gradle user homes and class outputs were already separate, they still shared the fixture's mutable Gradle build directory and project cache. This intermittently corrupted Kotlin compiler snapshots on Windows and plugin configuration state on macOS.
Keep each invocation's build directory and Gradle project cache under the importing project's
objdirectory. This fully isolates parallel builds while preserving the existing direct-Gradle defaults.Testing
dotnet build external\Java.Interop\Java.Interop.sln -c Releasewith the local JDK tool properties configured. Both Kotlin Gradle invocations completed concurrently.