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

Run jcmd 0 GC.run on windows before linking tests on CI #1442

Merged
merged 3 commits into from
Mar 21, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/TEST.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ jobs:
- { name: Gradle cache, uses: ./.github/actions/gradle-cache }
- { name: Testing JVM on windows, shell: cmd, run: "CALL gradlew.bat jvmTest", env: { EGL_LOG_LEVEL: debug, LIBGL_DEBUG: verbose, LIBGL_ALWAYS_SOFTWARE: true, MESA_DEBUG: true } }
- { name: Archive Test Results, if: failure(), uses: actions/upload-artifact@v3, with: { name: screenshot-test-results-windows, retention-days: 21, path: "**/build/reports", if-no-files-found: ignore } }
- { name: Testing Kotlin/Native MingwX64Test, shell: cmd, run: CALL gradlew.bat mingwX64Test }
- { name: Testing Kotlin/Native MingwX64Test, shell: cmd, run: CALL gradlew.bat --no-parallel mingwX64Test }
- { name: Publish gradle plugin, shell: cmd, run: "CALL gradlew.bat :korge-gradle-plugin:publishToMavenLocal :korge-reload-agent:publishToMavenLocal" }
- { name: Publish X64, shell: cmd, run: CALL gradlew.bat publishMingwX64PublicationToMavenLocal publishKotlinMultiplatformPublicationToMavenLocal }
- { name: e2e test, shell: cmd, working-directory: e2e-test, run: CALL gradlew.bat checkReferencesNative --stacktrace }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,18 +172,29 @@ object RootKorlibsPlugin {
}

fun Project.initShowSystemInfoWhenLinkingInWindows() {
fun Task.configureGCAndSystemInfo() {
val task = this
task.doFirst {
execThis { commandLine("systeminfo") }
println("jcmd -l; jcmd 0 GC.heap_info; jcmd 0 GC.run")
execThis { commandLine("jcmd", "-l") }
execThis { commandLine("jcmd", "0", "GC.heap_info") }
repeat(5) { execThis { commandLine("jcmd", "0", "GC.run") } }
execThis { commandLine("systeminfo") }
}
task.doLast { execThis { commandLine("systeminfo") } }
}

rootProject.afterEvaluate {
subprojectsThis {
val linkDebugTestMingwX64 = project.tasks.findByName("linkDebugTestMingwX64")
if (linkDebugTestMingwX64 != null && isWindows && inCI) {
linkDebugTestMingwX64.doFirst { execThis { commandLine("systeminfo") } }
linkDebugTestMingwX64.doLast { execThis { commandLine("systeminfo") } }
linkDebugTestMingwX64.configureGCAndSystemInfo()
}

val mingwX64Test = project.tasks.findByName("mingwX64Test")
if (mingwX64Test != null && isWindows && inCI) {
mingwX64Test.doFirst { execThis { commandLine("systeminfo") } }
mingwX64Test.doLast { execThis { commandLine("systeminfo") } }
mingwX64Test.configureGCAndSystemInfo()
}
}
}
Expand Down