SonarCloud step hanging in GitLab pipelines for dotnet 2.1

  • ALM used: GitLab
  • CI system used: GitLab
  • Scanner command used when applicable:
    This command is executed in between the dotnet sonarscanner begin and end:
      dotCover.sh dotnet
      --output=tests/dotCover.Output.html
      --reportType=HTML
      --CoreInstructionSet=x64
      -- test
      --logger trx
      --filter FullyQualifiedName!~IntegrationTests
      --results-directory "${CI_PROJECT_DIR}/tests"
      --no-restore
  • Languages of the repository: dotnet 2.1, C#
  • Error observed:
    Today (03/03/2021), sonarcloud step hangs after printing “Total time: 35.7635 Seconds” and does not proceed to execute dotnet sonarscanner end.
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:13.74]     XXXXXXXXXXXXXXX [SKIP]
  !
XXXXXXXXXXXXXXX [1ms]
Results File: /builds/xxx/xxxx/xxx/xxx/tests/xxx.trx
Test Run Successful.
Total tests: 566
     Passed: 565
    Skipped: 1
 Total time: 35.7635 Seconds

Yesterday (02/03/2021), sonarcloud step executed successfully and printed the following:

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:09.34]     XXXXXXXXXXXXXXX [SKIP]
  !
XXXXXXXXXXXXXXX [1ms]
Results File: /builds/xxx/xxxx/xxx/xxx/tests/xxx.trx
Test Run Successful.
Total tests: 566
     Passed: 565
    Skipped: 1
 Total time: 35.2683 Seconds
[JetBrains dotCover] Coverage session finished [03/02/2021 09:39:30]
[JetBrains dotCover] Coverage results post-processing started [03/02/2021 09:39:30]
[JetBrains dotCover] Merging snapshots [03/02/2021 09:39:30]
[JetBrains dotCover] Snapshots merging finished [03/02/2021 09:39:31]
[JetBrains dotCover] Report generation started [03/02/2021 09:39:31]
[JetBrains dotCover] Report generation finished [03/02/2021 09:39:32]
[JetBrains dotCover] Coverage results post-processing finished [03/02/2021 09:39:32]
$ dotnet sonarscanner end /d:sonar.login="${SONAR_TOKEN}"
SonarScanner for MSBuild 5.0.4
Using the .NET Core version of the Scanner for MSBuild
Post-processing started.
Using the supplied value for SONAR_SCANNER_OPTS. Value: -Xmx1G
Calling the SonarScanner CLI...

nothing was changed on our end, codebase remained the same

  • Potential workaround: unsure

Hi @zhantaof and welcome to the community.

So just to be sure, it seems to me that the faulty task is the dotCover.sh, right ? It should show the diverse [JetBrains dotCover] Coverage session finished [03/02/2021 09:39:30] log messages.

What happen if you deactivate both SonarScanner steps and retry several times ? Do you have that hang as well ?

Thanks.
Mickaël

Hi @mickaelcaro, thanks for the response.

Yes, it looks to be an issue with the dotCover.sh. It hangs after “Total time” every single time:

Test Run Successful.
Total tests: 566
     Passed: 565
    Skipped: 1
 Total time: 35.7635 Seconds

So it doesn’t even show “the diverse [JetBrains dotCover] Coverage session finished [03/02/2021 09:39:30] log messages”.

When we disable the SonarScanner step, the pipeline succeeds with no hang whatsoever. We have also noticed our dotnet 3.1 pipeline does not have this hanging issue. The only difference with the dotnet 3.1 pipeline is that it does not use dotCover.sh in between Sonarscanner begin and end. Instead, it has the following:

      dotnet test
      --logger trx
      --results-directory "tests"
      --no-restore
      --filter FullyQualifiedName!~IntegrationTests
      --collect:"XPlat Code Coverage"
      -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
      --verbosity ${DOTNET_LOGLEVEL:-m}      

Hi, any update on this?

Hi @zhantaof

Any possibility to have a more verbose log please ? Without it there’s not that much we can do.

Thanks in advance.