-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Update exception handling in the test module #2953
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
Update exception handling in the test module #2953
Conversation
04ff300
to
4f1d7df
Compare
4f1d7df
to
68832cc
Compare
5fd866a
to
d8ae171
Compare
d70d5e2
to
d651dec
Compare
d8ae171
to
80e076f
Compare
d651dec
to
f158e36
Compare
b7f4216
to
015b06c
Compare
2a12be4
to
6b589e2
Compare
015b06c
to
e821121
Compare
6b589e2
to
11c3712
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record: the final decision was to hide TestExceptionHandler
from public API and prohibit any custom coroutine exceptions handlers.
The proposed API has unwanted pitfalls and we do not have enough driving use-cases to provide it in its current form
e821121
to
7765d76
Compare
11c3712
to
5ae073d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise looks good
kotlinx-coroutines-test/common/src/TestCoroutineExceptionHandler.kt
Outdated
Show resolved
Hide resolved
Forbidding passing a |
CoroutineExceptionHandler { _, throwable -> | ||
val ownExceptionHandler = run { | ||
val lock = SynchronizedObject() | ||
object : AbstractCoroutineContextElement(CoroutineExceptionHandler), TestCoroutineScopeExceptionHandler { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The overall approach looks good
7765d76
to
6a33516
Compare
9e5e8f8
to
9f635e9
Compare
This change provides the means to more easily define what to do with unhandled exceptions during tests.