Long runtime of SonarCloudAnalyze, espcially to compress the zip file of the analysis

Template for a good new topic, formatted with Markdown:

  • ALM used:Azure DevOps
  • CI system used: Azure DevOps
  • Scanner command used when applicable (private details masked)
  • Languages of the repository: C#, HTML, JSON
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)

Using Task SonarCloudAnalyze@4 (4.0.2) the build server needs about 14 minutes to compress the zip file of the analysis. The task was canceled after more then 34 minutes runtime (complete build runtime 60 minutes). Building the solution in comparission oly takes 15m 29s - thus sonar analyze takes more then double of the build time.

11:54:20.835 INFO: SCM writing changed lines (done) | time=3157ms
11:54:29.365 INFO: Analysis report generated in 58826ms, dir size=88 MB
12:08:02.68 INFO: Analysis report compressed in 813299ms, zip size=33 MB
12:08:29.19 INFO: Analysis report uploaded in 26510ms

Log from Bowser window.zip (211.9 KB)

Hi,

Could you add -Dsonar.verbose=true to your analysis command line and give us the resulting analysis log?

Off-hand, I’m suspecting something going on with your file system. It’s definitely not normal (as I suspect you know :wink: ) for zip compression to double analysis duration.

 
Thx,
Ann

Hi @milbrandt,

The extended duration for report compression may be related to the Azure agent running your pipeline.

Could you provide more details about the Azure agent? Specifically, is it self-hosted or Microsoft-hosted? What kind of agent is it?

You can typically find this information in the Initialize job task at the start of your pipeline.

Hi @antoine.vinot
it is a self-hosted agent on Windows, Visual Studio 18

Starting: Initialize job
Agent name: 'XXX'
Agent machine name: 'XXX'
Current agent version: '4.268.0'
Agent running as: 'XXX'
Prepare build directory.
Set build variables.
Download all required tasks.
Checking job knob settings.
   Knob: DockerActionRetries = true Source: $(VSTSAGENT_DOCKER_ACTION_RETRIES) 
   Knob: UseGitLongPaths = true Source: $(USE_GIT_LONG_PATHS) 
   Knob: UseNode24withHandlerData = True Source: $(DistributedTask.Agent.UseNode24withHandlerData) 
   Knob: EnableIssueSourceValidation = true Source: $(ENABLE_ISSUE_SOURCE_VALIDATION) 
   Knob: AgentEnablePipelineArtifactLargeChunkSize = true Source: $(AGENT_ENABLE_PIPELINEARTIFACT_LARGE_CHUNK_SIZE) 
   Knob: DisableNode6Tasks = true Source: $(AGENT_DISABLE_NODE6_TASKS) 
   Knob: ContinueAfterCancelProcessTreeKillAttempt = true Source: $(VSTSAGENT_CONTINUE_AFTER_CANCEL_PROCESSTREEKILL_ATTEMPT) 
   Knob: ProcessHandlerSecureArguments = true Source: $(AZP_75787_ENABLE_NEW_LOGIC) 
   Knob: ProcessHandlerSecureArguments = false Source: $(AZP_75787_ENABLE_NEW_LOGIC_LOG) 
   Knob: ProcessHandlerTelemetry = true Source: $(AZP_75787_ENABLE_COLLECT) 
   Knob: UseNewNodeHandlerTelemetry = True Source: $(DistributedTask.Agent.USENEWNODEHANDLERTELEMETRY) 
   Knob: ProcessHandlerEnableNewLogic = true Source: $(AZP_75787_ENABLE_NEW_PH_LOGIC) 
   Knob: EnableResourceMonitorDebugOutput = true Source: $(AZP_ENABLE_RESOURCE_MONITOR_DEBUG_OUTPUT) 
   Knob: EnableResourceUtilizationWarnings = true Source: $(AZP_ENABLE_RESOURCE_UTILIZATION_WARNINGS) 
   Knob: IgnoreVSTSTaskLib = true Source: $(AZP_AGENT_IGNORE_VSTSTASKLIB) 
   Knob: FailJobWhenAgentDies = true Source: $(FAIL_JOB_WHEN_AGENT_DIES) 
   Knob: CheckForTaskDeprecation = true Source: $(AZP_AGENT_CHECK_FOR_TASK_DEPRECATION) 
   Knob: CheckIfTaskNodeRunnerIsDeprecated246 = True Source: $(DistributedTask.Agent.CheckIfTaskNodeRunnerIsDeprecated246) 
   Knob: UseNode20ToStartContainer = True Source: $(DistributedTask.Agent.UseNode20ToStartContainer) 
   Knob: EnableTimeoutLogFlushing = True Source: $(DistributedTask.Agent.EnableTimeoutLogFlushing) 
Agent.OS Windows_NT
Agent.OSArchitecture X64
Agent.OSVersion 10.0.26200
JAVA_HOME C:\Java\jdk-17.0.9+9	
PROCESSOR_ARCHITECTURE AMD64
PROCESSOR_IDENTIFIER Intel64 Family 6 Model 85 Stepping 7, GenuineIntel
PROCESSOR_LEVEL 6
PROCESSOR_REVISION 5507