Azure-devops-docs: parallel vs. matrix

Created on 17 Sep 2018  Â·  10Comments  Â·  Source: MicrosoftDocs/azure-devops-docs

> Slicing
> When parallel is specified and matrix is not defined ...

Does this mean parallel and matrix can also be used at the same time? Multi-Configuration above this section only uses matrix together with maxParallel.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

devopprod

Most helpful comment

Fix in progress. Syntactically, all three are siblings. Semantically:

  • You can use maxParallel alongside either of the strategies.
  • The two strategies parallel and matrix are mutually exclusive, so you can only use one or the other.

All 10 comments

Thank you for your feedback. I have passed this on to the product team for advice.

@janpio - no, matrix and parallel cannot be used together.
For an example of how to use parallel for slicing, see https://docs.microsoft.com/en-us/azure/devops/pipelines/test/parallel-testing-any-test-runner?view=vsts

Please update the Slicing documentation specifically and documentation on parallelism in general so this becomes clearer.

So matrix should be run in parallel by default?

Searching for information on this is quite a pain right now, especially when parts of the docs contradict each other (like the YAML reference showing matrix, parallel and maxParallel as equal attributes: https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts#job)

@vijayma @andyjlewis - can you help with this?

Just stumbled over some documentation that shows all 3 in the same configuration:

The full syntax to specify an agent job is:

...
  strategy:
    parallel: number
    maxParallel: number
    matrix: { string: { string: string } }

https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=vsts&tabs=yaml

I'm pretty sure this is just not fully fleshed out all the way through all the docs.
I appreciate you reopening this and replying.

Fix in progress. Syntactically, all three are siblings. Semantically:

  • You can use maxParallel alongside either of the strategies.
  • The two strategies parallel and matrix are mutually exclusive, so you can only use one or the other.

There was a bug that prevented the matrix from running in parallel by default that has no been fixed. It should roll out over the next few weeks on the service.

I have a build pipeline using the matrix strategy, and I'm specifying maxParallel: 1 but I'm seeing multiple jobs from the matrix running at the same time. maxParallel doesn't seem to be honored.

@ajklotz it seems to be working for me. But feel free to report it over on Developer Community.

Disregard, I had different sets of Jobs and the matrix didn't apply to the other ones. My fault!

Was this page helpful?
0 / 5 - 0 ratings