Skip to content
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

Fixes opt-out for scripted batch execution #6054

Merged
merged 2 commits into from
Nov 5, 2020
Merged

Fixes opt-out for scripted batch execution #6054

merged 2 commits into from
Nov 5, 2020

Conversation

eatkins
Copy link
Contributor

@eatkins eatkins commented Nov 3, 2020

sbt 1.4.0 made batch execution the default behavior. The following setting can be used to opt out of the behavior:

scriptedBatchExecution := false

To increase parallelism use:

scriptedParallelInstances := 2

original description

This PR makes the scripted plugin work the way it used to in older sbt versions when scriptedBatchExecution := false. It also makes scriptedBatchExecution := true the default because I think the performance improvement is worth it for most builds even though it can cause issues like in #6042. I can remove the second commit if there is disagreement on changing the default.

eed3si9n
eed3si9n previously approved these changes Nov 3, 2020
eed3si9n
eed3si9n previously approved these changes Nov 3, 2020
When 1 is passed in as the sbtInstances argument to runInParallel, all
of the tests get batched together in a single sbt session. The run
methods in ScriptedRunner were delegating to runInParallel and as a
result were causing all of the tests to be batched, which was not how it
used to work in sbt 1.3.x. To fix this we can instead pass in
Int.MaxValue for the number of sbt instances. The Int.MaxValue parameter
causes the batch size to be set to 1 in the batchScriptedRunner method
which causes the scriptedRunners variable to have the same size as the
number of tests. We then can prevent a parallel array from being used if
the sbtInstances is deteced to be the Int.MaxValue sentinel.
sbt itself effectively runs its scripted test with
scriptedBatchExecution true and scriptedParallelInstances 1. The
performance is much better when this works. This can cause issues, see
#6042, but we inadvertently made this
behavior the default in 1.4.0 and it took about a month before #6042 was
reported so I think most users would benefit from this default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants