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

Testing: Add a LiveParallelizable that runs Live tests in parallel #6905

Closed
tg-msft opened this issue Jul 11, 2019 · 5 comments · Fixed by #17454
Closed

Testing: Add a LiveParallelizable that runs Live tests in parallel #6905

tg-msft opened this issue Jul 11, 2019 · 5 comments · Fixed by #17454
Assignees
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files)
Milestone

Comments

@tg-msft
Copy link
Member

tg-msft commented Jul 11, 2019

We need to run tests sequentially when AZURE_TEST_MODE is Record or Playback. It would be nice to run tests in parallel when AZURE_TEST_MODE is Live but nUnit doesn't allow that kind of flexibility out of the box. We should investigate adding a custom LiveParallelizable attribute at the assembly level.

@tg-msft tg-msft added Storage Storage Service (Queues, Blobs, Files) Test Debt Client This issue points to a problem in the data-plane of the library. Azure.Core labels Jul 11, 2019
@tg-msft tg-msft added this to the Backlog milestone Jul 11, 2019
@tg-msft tg-msft self-assigned this Jul 11, 2019
@AlexGhiondea AlexGhiondea modified the milestones: Backlog, Sprint 157 Aug 2, 2019
@tg-msft tg-msft removed their assignment Sep 25, 2019
@pakrym pakrym modified the milestones: [2020] January, [2020] March Feb 7, 2020
@pakrym pakrym modified the milestones: [2020] March, Backlog Mar 9, 2020
@vinagesh
Copy link
Member

We recently started using the test framework and see that if there are multiple tests within a class, we cannot run the tests with the Parallelizable attribute. But we would like to run the live tests in parallel. Voting to have this feature.

@kasobol-msft
Copy link
Contributor

@tg-msft @pakrym Would it make sense to make recording framework parallel-friendly instead of this? I'd appreciate faster CI builds.

FYI I was trying some parallelization here #16883 but I didn't want to pursue this further as it turned out to be quite complex to solve.

@pakrym
Copy link
Contributor

pakrym commented Nov 11, 2020

I don't think we can make it parallel friendly because of how NUnit manages test class instances (not creating an instance per test).

@kasobol-msft
Copy link
Contributor

kasobol-msft commented Nov 11, 2020

@pakrym We won't be able to go as far as parallelization per single test. That is probably true for live tests (at least for Storage) due to limitation you mentioned.

However, there's a way to apply NUnit Parallelizable attribute in such a way that test classes are executed in parallel but within class methods go serially (there are few ways to achieve that). I would take ability to go parallel per class any day instead of current situation.

In my experiment I applied [Parallelizable(ParallelScope.Self)] on StorageTestBase. The issue I was facing is somewhere in this code

var suitePermutations = GeneratePermutations();
foreach (var (fixture, isAsync, serviceVersion, parameter) in suitePermutations)
{
foreach (TestSuite testSuite in fixture.BuildFrom(typeInfo, filter))
{
Process(testSuite, serviceVersion, isAsync, parameter);
yield return testSuite;
}
}
. Somehow it makes recording/recordingtransport or something in that vicinity being shared between sync/async mode which I couldn't pin point. When I hacked this to generate only one permutation per tests I got pretty good results, i.e. whole assembly ran per-class-parallel and tests were green (in playback mode).

@pakrym
Copy link
Contributor

pakrym commented Nov 12, 2020

Very good point Kamil. I think the parallelization of test classes is technically achieveable.

annelo-msft pushed a commit to annelo-msft/azure-sdk-for-net that referenced this issue Feb 17, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 29, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants