Skip to content

Commit 7877e21

Browse files
Nikita Kovalqwwdfsad
Nikita Koval
authored andcommitted
Revert select implementation via selectOld and turn on all the tests
1 parent 62f6586 commit 7877e21

File tree

7 files changed

+4
-12
lines changed

7 files changed

+4
-12
lines changed

kotlinx-coroutines-core/api/kotlinx-coroutines-core.api

-4
Original file line numberDiff line numberDiff line change
@@ -1271,10 +1271,6 @@ public final class kotlinx/coroutines/selects/SelectKt {
12711271
public static final fun select (Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
12721272
}
12731273

1274-
public final class kotlinx/coroutines/selects/SelectOldKt {
1275-
public static final fun selectOld (Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
1276-
}
1277-
12781274
public final class kotlinx/coroutines/selects/SelectUnbiasedKt {
12791275
public static final fun selectUnbiased (Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
12801276
}

kotlinx-coroutines-core/common/src/selects/Select.kt

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ public suspend inline fun <R> select(crossinline builder: SelectBuilder<R>.() ->
5656
contract {
5757
callsInPlace(builder, InvocationKind.EXACTLY_ONCE)
5858
}
59-
return selectOld(builder)
6059
return SelectImplementation<R>(coroutineContext).run {
6160
builder(this)
6261
// TAIL-CALL OPTIMIZATION: the only

kotlinx-coroutines-core/common/src/selects/SelectOld.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ internal class UnbiasedSelectBuilderImpl<R>(
8585
}
8686

8787
// This is the old version of `select`. It should work to guarantee binary compatibility.
88-
public suspend inline fun <R> selectOld(crossinline builder: SelectBuilder<R>.() -> Unit): R {
88+
internal suspend inline fun <R> selectOld(crossinline builder: SelectBuilder<R>.() -> Unit): R {
8989
return suspendCoroutineUninterceptedOrReturn { uCont ->
9090
val scope = SelectBuilderImpl(uCont)
9191
try {

kotlinx-coroutines-core/jvm/test/channels/ChannelUndeliveredElementStressTest.kt

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import kotlin.test.*
1818
* Tests resource transfer via channel send & receive operations, including their select versions,
1919
* using `onUndeliveredElement` to detect lost resources and close them properly.
2020
*/
21-
@Ignore
2221
@RunWith(Parameterized::class)
2322
class ChannelUndeliveredElementStressTest(private val kind: TestChannelKind) : TestBase() {
2423
companion object {

kotlinx-coroutines-core/jvm/test/lincheck/ChannelsLincheckTest.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ abstract class ChannelLincheckTestBase(
7070
else false
7171
}
7272

73-
// @Operation(promptCancellation = true)
73+
@Operation(promptCancellation = true)
7474
suspend fun sendViaSelect(@Param(name = "value") value: Int): Any = try {
7575
select<Unit> { c.onSend(value) {} }
7676
} catch (e: NumberedCancellationException) {
@@ -90,7 +90,7 @@ abstract class ChannelLincheckTestBase(
9090
.onSuccess { return it }
9191
.onFailure { return if (it is NumberedCancellationException) it.testResult else null }
9292

93-
// @Operation(promptCancellation = true)
93+
@Operation(promptCancellation = true)
9494
suspend fun receiveViaSelect(): Any = try {
9595
select<Int> { c.onReceive { it } }
9696
} catch (e: NumberedCancellationException) {

kotlinx-coroutines-core/jvm/test/lincheck/MutexLincheckTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class MutexLincheckTest : AbstractLincheckTest() {
2222
@Operation(promptCancellation = true)
2323
suspend fun lock(@Param(name = "owner") owner: Int) = mutex.lock(owner.asOwnerOrNull)
2424

25-
// @Operation(promptCancellation = true)
25+
@Operation(promptCancellation = true)
2626
suspend fun onLock(@Param(name = "owner") owner: Int) = select<Unit> { mutex.onLock(owner.asOwnerOrNull) {} }
2727

2828
@Operation(handleExceptionsAsResult = [IllegalStateException::class])

kotlinx-coroutines-debug/test/SanitizedProbesTest.kt

-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import kotlinx.coroutines.*
99
import kotlinx.coroutines.debug.*
1010
import kotlinx.coroutines.selects.*
1111
import org.junit.*
12-
import org.junit.Ignore
1312
import org.junit.Test
1413
import java.util.concurrent.*
1514
import kotlin.test.*
@@ -75,7 +74,6 @@ class SanitizedProbesTest : DebugTestBase() {
7574
deferred.cancelAndJoin()
7675
}
7776

78-
@Ignore
7977
@Test
8078
fun testSelectBuilder() = runTest {
8179
val selector = launchSelector()

0 commit comments

Comments
 (0)