Test step is taking too much time to execute while performing SCA on Sonar Cloud

Template for a good new topic, formatted with Markdown:

  • ALM used (Azure DevOps)
  • CI system used (Azure DevOps YAML )
  • Languages of the repository : .NET Core
  • Error observed : We can’t say it as error it is an issue that we have found while executing SCA and code coverage part in Azure YAML to Sonar Cloud test task is talking more time for executing.

Issue in detail:
We are having .NET Core applications integrated with Azure Pipeline and Sonar Cloud.
We have normal dotnet core build steps and sonar cloud 4 tasks including test task for generating code coverage.
We have 6 test modules and 700 + test cases included in it which takes max 5 Min to run in the visual studio but when it comes to Coverlet test in the pipeline it takes long time and We have observed significant delays during the test execution phase, specifically prolonged waiting periods following the execution of each module. During these intervals, no logs are generated, which limits us to analyze or identify the underlying issue. we
YAML.txt (3.2 KB)
Dot_Net_Test_Step.txt (302 Bytes)
have executed the pipeline using multiple agents please find the execution time details below:

Virtual Machine Scale set Agents Self-Hosted Agent
Total Execution Time: - 2 hr. 20 min Total Execution Time: - 1 hr. 17 min
Actual Execution time: - 47 min Actual Execution Time: - 22 min
Waiting time across the test modules: - 1 hr. 33 min Waiting time across the test modules: - 55 Min

Attaching the test step details and logs. Please let us know the suitable solution for this.

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hi,

It is possible that analysis can slow your build since the rules in your profile are run during the build. But I’m not aware of any impact at all on the test step. It’s also not clear to me where SCA comes into this.

Can you provide logs, as well as the Sonar_Analysis_Step.yml mentioned in the YAML file you provided?

 
Thx,
Ann

Hi Ann,

We are encountering a performance issue while integrating code coverage in our YAML pipeline using the Coverlet tool. When executing dotnet test directly, the test cases complete in under 10 minutes. However, after integrating with SonarCloud, the execution time increases significantly and takes more than an hour.

We are sharing the logs from the test task as well as all Sonar_Analysis_Steps. Kindly review them and let us know if there are any possible optimizations or solutions to reduce the execution time of the test task.

10_Test-1.txt (59.2 KB)
11_Run Code Analysis.txt (721.6 KB)
12_Publish Quality Gate Result.txt (1.1 KB)
7_Prepare analysis on SonarCloud.txt (2.8 KB)

Hi,

I don’t know what to tell you. We don’t have any interaction at all with the Coverlet tool.

You mean when you run them locally versus in your pipeline? I’d say that’s where your investigation needs to focus.

 
HTH,
Ann