I will try with the sleep workaround; for us it is happening with all projects, no matter their size.
Will report back.
withSonarQubeEnv('...') {
sh "../../../sonar-scanner/bin/sonar-scanner"
}
sleep(10)
qualitygate = waitForQualityGate()
if (qualitygate.status != "OK") {
...
}