Skip to content

Commit

Permalink
Disable timing-sensitive test on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
qwwdfsad committed Dec 19, 2024
1 parent 8f83057 commit ec83195
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kotlinx-coroutines-core/jvm/test/ThreadLocalsLeaksTest.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package kotlinx.coroutines

import kotlinx.coroutines.testing.TestBase
import kotlinx.coroutines.testing.isJavaAndWindows
import java.lang.ref.WeakReference
import kotlin.coroutines.AbstractCoroutineContextElement
import kotlin.coroutines.Continuation
Expand Down Expand Up @@ -74,6 +75,11 @@ class ThreadLocalCustomContinuationInterceptorTest : TestBase() {
private var letThatSinkIn: Any = "What is my purpose? To frag the garbage collctor"

private fun ensureCoroutineContextGCed(coroutineContext: CoroutineContext, suspend: Boolean) {
// Tests are pretty timing-sensitive and flake ehavily on our virtualized Windows environment
if (isJavaAndWindows) {
return
}

fun forceGcUntilRefIsCleaned(ref: WeakReference<CoroutineName>) {
while (ref.get() != null) {
System.gc()
Expand Down

0 comments on commit ec83195

Please sign in to comment.