Wait for quality gate parameter leads to sonarqube execution failure

When building c++ projects with build-wrapper with additional wait for quality gate argument leads sonarqube execution failure. when removing wait for quality gate solve the issue but it is not returning quality gate status back.

build-wrapper-win-x86-64.exe --out-dir build_wrapper_output_directory CMakeDebug.bat
sonar-scanner.bat -X

Hey there.

That is pretty much exactly what sonar.qualitygate.wait is supposed to do – wait for the Quality Gate and exit with an error code if the Quality Gate has failed. If it’s not included, it doesn’t wait for the Quality Gate.

Are you expecting different behavior?

but in my other projects (where we use build wrapper to build and also quality gate is failing) , sonarqube execution is success but quality gate is failing. My expected behaviour is , success in sonarqube execution and return quality gate status as failed.

For those other projects, you likely haven’t specified sonar.qualitygate.wait=true.

It’s not possible for SonarQube to wait for the Quality Gate and only return the status as information – it will either fail the execution, or let it pass, based on whether the Quality Gate failed or passed.

I want to get the quality gate status after sonarqube execution. if i don’t specify sonar.qualitygate.wait=true , the execution is passing and not returning gate status.Once i specify sonar.qualitygate.wait=true it returning quality gate status but overall execution is failling