From 8668797afd5cda17efcb10a537105172cfae6d3f Mon Sep 17 00:00:00 2001 From: Ilya Matveev Date: Fri, 28 Jan 2022 19:31:00 +0700 Subject: [PATCH] [K/N][tests] Do not run backed.native tests with aggressive GC --- kotlin-native/backend.native/tests/build.gradle | 7 ------- .../backend.native/tests/runtime/collections/hash_map1.kt | 5 ----- .../tests/runtime/memory/stress_gc_allocations.kt | 5 ++--- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index ec3a395b52b..af8777a1ffb 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -110,13 +110,6 @@ tasks.withType(RunExternalTestGroup.class).configureEach { ext.isExperimentalMM = project.globalTestArgs.contains("-memory-model") && project.globalTestArgs.contains("experimental") ext.isNoopGC = project.globalTestArgs.contains("-Xgc=noop") -if (ext.isExperimentalMM) { - // TODO: Make it more aggressive and only turn it on for a subset of tests. - tasks.withType(KonanCompileNativeBinary.class).configureEach { - extraOpts "-Xbinary=gcSchedulerType=aggressive" - } -} - // TODO: It also makes sense to test -g without asserts, and also to test -opt with asserts. if (project.globalTestArgs.contains("-g")) { tasks.withType(KonanCompileNativeBinary.class).configureEach { diff --git a/kotlin-native/backend.native/tests/runtime/collections/hash_map1.kt b/kotlin-native/backend.native/tests/runtime/collections/hash_map1.kt index b9475ebed8d..166f2ecacbc 100644 --- a/kotlin-native/backend.native/tests/runtime/collections/hash_map1.kt +++ b/kotlin-native/backend.native/tests/runtime/collections/hash_map1.kt @@ -89,11 +89,6 @@ fun testClear() { } @Test fun runTest() { - // TODO: Do not manually control this. - if (Platform.memoryModel == MemoryModel.EXPERIMENTAL) { - GC.threshold = 1000000 - GC.thresholdAllocations = 1000000 - } testRehashAndCompact() testClear() println("OK") diff --git a/kotlin-native/backend.native/tests/runtime/memory/stress_gc_allocations.kt b/kotlin-native/backend.native/tests/runtime/memory/stress_gc_allocations.kt index bdaecf5c970..18aefea4f64 100644 --- a/kotlin-native/backend.native/tests/runtime/memory/stress_gc_allocations.kt +++ b/kotlin-native/backend.native/tests/runtime/memory/stress_gc_allocations.kt @@ -58,9 +58,8 @@ fun test() { val progressReportsCount = 100 if (Platform.memoryModel == MemoryModel.EXPERIMENTAL) { - kotlin.native.internal.GC.thresholdAllocations = retainLimit - // Effectively disable trigger on safepoints. - kotlin.native.internal.GC.threshold = Int.MAX_VALUE + kotlin.native.internal.GC.autotune = false + kotlin.native.internal.GC.targetHeapBytes = retainLimit } // On Linux, the child process might immediately commit the same amount of memory as the parent.