-
Notifications
You must be signed in to change notification settings - Fork 33
keep dispatcher and scope config internal #36
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
Conversation
@@ -364,7 +345,7 @@ class AndroidLifecyclePluginTests { | |||
// Simulate activity startup | |||
lifecyclePlugin.onActivityCreated(mockActivity, mockBundle) | |||
|
|||
assertTrue(mockPlugin.ran) | |||
verify (timeout = 2000){ mockPlugin.updateState(true) } |
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.
is this timeout necessary due to us not being able to run the tests with the testDispatcher
?
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.
correct. because we are not able to use testDispatcher
, things running async. there is a delay before the update happen. the verify
waits until the statement happened or timeout reached, whichever one comes first.
internal var ioDispatcher: CoroutineDispatcher = Executors.newFixedThreadPool(1) | ||
.asCoroutineDispatcher() | ||
|
||
internal var analyticsScope: CoroutineScope = MainScope() |
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.
lets make this CoroutineScope(SupervisorJob())
rather than using the main scope
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.
agree. I was also worried about it running in main thread. changing it now
Changes:
Configuration
constructors, keep them internalAdditional Changes