feat(engine): allow to override has_enough_parallelism #14608
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Towards #14376
Extracted from #14482
The current
StateRootTask
implementation requires the host to have a minimum number of threads to run properly and prevent eventual deadlocks. CurrentlyStateRootTask
is disabled ifhas_enough_parallelism
returns true. For tests, we wantStateRootTask
to be enabled even on constrained environments, like CI, so that we can exercise the codepaths that use it.Additionally, with the approach introduced in #14482 for engine unit tests
StateRootTask
results are mocked, and we are not spinning up any real thread, so running the tests on hosts with reduced parallelism should be ok.These changes add a
has_enough_parallelism
field toTreeConfig
, move the decision to use state root task to one of its methods and adds a setter to override the parallelism value read from the system, so that we can run tests with state root enabled if needed.