A temporary fix was introduced here: https://github.com/elastic/apm-server/pull/17682, to allow us to continue with testing APM server. Once the issue has been resolved, the fix should be reverted. In particular, removing the retry part after `waitForAPMToBePublishReady` fails.