-
Notifications
You must be signed in to change notification settings - Fork 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
Override munit ExecutionContext with one from IORuntime #124
Override munit ExecutionContext with one from IORuntime #124
Conversation
The tests seem to be flaky. I will investigate further tomorrow as there is no clear test failing as far as I can tell. |
This PR is currently blocked by a bug in cats-effect in the blocking part of the compute pool. I will follow up once fixed. |
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.
LGTM. The question is for my understanding rather than any block on this.
|
||
abstract class CatsEffectSuite | ||
extends FunSuite | ||
with CatsEffectAssertions | ||
with CatsEffectFixtures | ||
with CatsEffectFunFixtures { | ||
|
||
implicit val ioRuntime: IORuntime = IORuntime.global | ||
implicit def munitIoRuntime: IORuntime = IORuntime.global |
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.
I don't get why was val
changed on def
here. IORuntime.global
is a val
though.
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.
When offering an interface to a user, they might want to overwrite this munitIoRuntime
with a def
.
The same reason that munit itself has the munitExecutionContext
as a def
on the class we are overwriting.
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.
I get it, thanks. Seems reasonable 👍🏻
@milanvdm @armanbilge Maybe it is best to revert this change and wait until Cats Effect |
On the other hand, maybe it is not wise to have this change on the JVM at all. Every time a |
Please also don't rush to make changes, we'll continue to monitor the possible implications of this PR. |
IIUC from our Discord discussion, there is (at least) one The munit docs say that
So, won't the number of these per-test |
I published |
This change seems to fail fs2-grpc server streaming tests with regards to cancellation. Not sure what is happening, but restoring the previous execution context in private val parasiticExecutionContext = new ExecutionContext {
def execute(runnable: Runnable): Unit = runnable.run()
def reportFailure(cause: Throwable): Unit = cause.printStackTrace()
}
override val munitExecutionContext: ExecutionContext = parasiticExecutionContext |
@ahjohannessen Thanks for the pointer, I will investigate. |
Closes #110
This overrides the default munit
parasitic-execution-context
with the one fromIORuntime.global
.Not sure if tests can be added for ScalaJS on the issue that @djspiewak mentions as I have no ScalaJS knowledge.