-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
CI: Run multi-threading test job with execution context #16339
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
base: master
Are you sure you want to change the base?
CI: Run multi-threading test job with execution context #16339
Conversation
|
There's a huge difference: with There's value in testing the concurrent case, but we also want to test parallelism, so there should be two jobs:
The second case needs either support in {% if Fiber.has_constant?(:ExecutionContext) %}
count = ENV["CRYSTAL_WORKERS"]?.try(&.to_i?) || 1
Fiber::ExecutionContext.current.resize(count)
{% end %} |
|
I think we need to add the EC resize to stdlib Apparently, |
|
|
||
| {% if Fiber.has_constant?(:ExecutionContext) && Fiber::ExecutionContext.class.has_method?(:current) %} | ||
| count = ENV["CRYSTAL_WORKERS"]?.try(&.to_i?) || 1 | ||
| # FIXME: ExecutionContext.current should return ExecutionContext::Parallel |
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.
This has been fixed in #16367.
|
The namespace is leaking in std specs because of |
|
There should be a distinct PR to resize the default execution context in |
|
It would be really nice if we had a simple test to check whether we're using execution contexts. |
|
Checking |
This is a much simpler alternative to #16329 which requires no refactoring. We already have a dedicated test job for multi-threading. It just doesn't use execution contexts yet. Adding that already gives great test coverage for the new feature.
It only runs
std_specbut that should be fine. I wouldn't expect much benefit from running compiler specs as well.There's not much point in keeping tests for only
-Dpreview_mtwithout-Dexecution_contextbecause we're not expecting to continue supporting the multi-threading preview with the old scheduler model.