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

Adding a test-helper class TestCoroutineContext. #1

Open
wants to merge 66 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
55a66ac
Improve ReceiveChannel operators implementations to guarantee closing
elizarov Mar 12, 2018
fe8ba6b
`onCompletion` added to `launch`, `async`, and `actor`
elizarov Mar 13, 2018
a4b5693
`onCompletion` added to `promise` and `future` (JDK8 and Guava)
elizarov Mar 13, 2018
ab66afc
Kotlin 1.2.30
elizarov Feb 20, 2018
9fe5f46
Deprecated CoroutineScope.coroutineContext which is replaced with
elizarov Feb 21, 2018
61cafea
Warning about future fail-fast in consumeEach is added to the guide
elizarov Mar 13, 2018
c7d10a4
Fix references to `coroutineContext` is the docs of all the builders
elizarov Mar 13, 2018
45bcb0b
Improve ChannelsConsumeTest to avoid spurious failures due to concurr…
elizarov Mar 14, 2018
d7d9e2f
IO: eliminate kotlin.Pair allocations
Mar 15, 2018
7831716
IO: introduce non-flushing joinTo
Mar 21, 2018
740c485
Fail with proper message if JDK_16 is not set
venkatperi Mar 21, 2018
26f4b9e
Add extension to ExecutorService to return closeable CoroutineDispatcher
deva666 Mar 20, 2018
8e38418
Explicitly mention that jcenter must be in a list of repos
elizarov Apr 3, 2018
6c2ed55
Merge remote-tracking branch 'origin/master' into develop
elizarov Apr 3, 2018
905a512
typo fixed
elizarov Apr 4, 2018
e1a5652
Extracted compilation configs into separate build files
elizarov Apr 4, 2018
3145290
Restructure build logic, prepare for native
elizarov Apr 11, 2018
aa461cf
Minimize cut-and-pasted code between JS and JVM
elizarov Apr 11, 2018
31550f1
Gradle 4.6
elizarov Apr 11, 2018
a735f9e
updated dependencies for android sample apps
Dmitry-Borodin Apr 9, 2018
379f210
Remove unavailable builder from js/kotlinx-coroutines-core-js/README.md
vkhikhlov Apr 10, 2018
4b94843
Merge remote-tracking branch 'origin/master' into develop
elizarov Apr 11, 2018
0bb18fc
Better way to set CoroutineContext#DEBUG value
dmytrodanylyk Apr 10, 2018
590c888
Documentation for debug property values
elizarov Apr 11, 2018
4cb5d19
Allow negative timeouts in delay, withTimeout and onTimeout on JVM
qwwdfsad Apr 11, 2018
4dcdc4a
Remove duplicate test file after rebase
qwwdfsad Apr 12, 2018
d521478
Separate Job (interface) and JobSupport (implementation). No other ch…
qwwdfsad Apr 13, 2018
931587a
Improve test coverage of CancellableCoroutine, add benchmark
qwwdfsad Apr 16, 2018
f3a5013
Decouple AbstractContinuation and CancellableContinuation from Job in…
qwwdfsad Apr 16, 2018
4aa18aa
Introduce cancelling state for AbstractContinuation, improve exceptio…
qwwdfsad Apr 17, 2018
80a2947
Make deprecated API hidden, replace deprecated API with new one
qwwdfsad Apr 17, 2018
f6430f4
Cleanup:
qwwdfsad Apr 17, 2018
b1a07ee
Setup dependency resolution strategy to force kotlin_version
ilya-g Apr 16, 2018
480d8e9
Fix complaints of the latest compiler: actuals without expect
ilya-g Apr 16, 2018
f0cd180
Suppress errors about default parameters in actual functions
ilya-g Apr 17, 2018
81f79c3
Do not use deprecated coroutineContext
ilya-g Apr 17, 2018
cc08426
Do not put kotlin dependency in package.json used for tests
ilya-g Apr 18, 2018
58fa752
Do not print npmPublish args at configuration phase
ilya-g Apr 18, 2018
f4eb05a
Kotlin 1.2.40
qwwdfsad Apr 25, 2018
4b9a559
CompletedExceptionally now always has cause and exception became an a…
qwwdfsad Apr 11, 2018
4f0d48b
Introducing awaitAll and joinAll extensions on JVM
qwwdfsad Apr 11, 2018
9c69279
Update readme, take the shortest link in Knit when resolving API refe…
qwwdfsad Apr 11, 2018
f0ef14e
Start jobs during awaitAll call to properly handle lazily started cor…
qwwdfsad Apr 11, 2018
203abb0
awaitAll review and todos
elizarov Apr 12, 2018
f5e63ca
Replacing isCancelledWithoutCause with proper contract on exception, …
qwwdfsad Apr 12, 2018
05d3823
awaitAll improvements: create defensive copy of jobs to consistently …
qwwdfsad Apr 12, 2018
c1092d5
Remove CompletedExceptionally#exception
qwwdfsad Apr 12, 2018
e89cd68
More comments about CancellationException and its consistent use;
elizarov Apr 25, 2018
189e995
awaitAll should be defined only for Deferred types and return results…
elizarov Apr 26, 2018
9619134
Migrate channels and related operators to common, so channels can be …
qwwdfsad Apr 20, 2018
2cdbfd7
Properly implement select clause for JS channels
qwwdfsad Apr 22, 2018
8a07168
Update readme for JS channels
qwwdfsad Apr 22, 2018
11d6b5b
Hide declarations in internal package
elizarov Apr 26, 2018
f2bdf60
Merged develop (js-channels work) into await-all
elizarov Apr 26, 2018
769d7dc
Moved awaitAll/joinAll to common module
elizarov Apr 26, 2018
0406a9b
Remove prev/next from common LockFreeLinkedList API
elizarov Apr 26, 2018
cd00643
Delay bug fixes:
qwwdfsad Apr 26, 2018
b4c7b40
Use disposeOnCompletion to remove cancelled delays
elizarov Apr 27, 2018
76146bb
Merge branch 'await-all' into develop
elizarov Apr 27, 2018
6d9f40f
Merge develop into decouple-job
elizarov Apr 28, 2018
dbd9e1c
Consistent naming of handler base classes and their concrete impls
elizarov Apr 28, 2018
3e9f244
Review and optimize usage of CancellableContinuation.invokeOnCancella…
elizarov Apr 28, 2018
e0b6db0
Leaking handles in awaitAll are fixed
elizarov Apr 28, 2018
87f2faa
Fix compiler warnings
qwwdfsad Apr 30, 2018
20dbd9f
Fast-path for isDone in ListenableFuture#await, stop using deprecated…
qwwdfsad May 7, 2018
afb3dea
Adding a test-helper class TestCoroutineContext.
Mar 20, 2018
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
Prev Previous commit
Next Next commit
Better way to set CoroutineContext#DEBUG value
Make `CoroutineContext#DEBUG_PROPERTY_NAME` public, also move `"on"`, `"off"`, `"auto"` to public constants.
Fixes Kotlin#316
dmytrodanylyk authored and elizarov committed Apr 11, 2018
commit 0bb18fcb4a482bfc8f3dd7bf496f041f91f84d28
Original file line number Diff line number Diff line change
@@ -21,15 +21,18 @@ import kotlin.coroutines.experimental.AbstractCoroutineContextElement
import kotlin.coroutines.experimental.ContinuationInterceptor
import kotlin.coroutines.experimental.CoroutineContext

private const val DEBUG_PROPERTY_NAME = "kotlinx.coroutines.debug"
const val DEBUG_PROPERTY_NAME = "kotlinx.coroutines.debug"
const val DEBUG_PROPERTY_VALUE_AUTO = "auto"
const val DEBUG_PROPERTY_VALUE_ON = "on"
const val DEBUG_PROPERTY_VALUE_OFF = "off"

private val DEBUG = run {
val value = try { System.getProperty(DEBUG_PROPERTY_NAME) }
catch (e: SecurityException) { null }
when (value) {
"auto", null -> CoroutineId::class.java.desiredAssertionStatus()
"on", "" -> true
"off" -> false
DEBUG_PROPERTY_VALUE_AUTO, null -> CoroutineId::class.java.desiredAssertionStatus()
DEBUG_PROPERTY_VALUE_ON, "" -> true
DEBUG_PROPERTY_VALUE_OFF -> false
else -> error("System property '$DEBUG_PROPERTY_NAME' has unrecognized value '$value'")
}
}