Closed nreid260 closed 1 month ago
The test passes for me, and the JetBrains CI is green (https://github.com/Kotlin/kotlinx.coroutines/commit/1bffe67a32d9d0285320f5b23fa94bc2b5f2b92e). So, seems like an issue on your side.
Also, the single-parameter limitedParallelism
overload isn't simply deprecated, it's replaced with a two-parameter overload where the second parameter has a default value, so passing just one parameter should still work.
The failing case seems somewhat unnecessary since the function being tested is
@deprecated
.
limitedParallelism(parallelism: Int, name: String? = null)
is not deprecated, and limitedParallelism(2)
at the problematic call site resolves to it, not to a deprecated overload.
Anyway, @nreid260 could you please elaborate on how to reproduce the issue?
The test outcome depends on the available parallelism of the test environment. So it's deterministic, but it will always fail for some users.
The bug appears to be in kotlinx-coroutines-core/jvm/src/scheduling/Dispatcher.kt
. There's a branch on available parallelism:
if (parallelism >= CORE_POOL_SIZE) {
return namedOrThis(name)
}
This makes me wonder what other behaviors aren't being tested because of the test env configuration...
I'm seeing this when testing with Bazel. The failing case seems somewhat unnecessary since the function being tested is @Deprecated.