Fix race with concurrent daemon startup in tests Upstream-commit: 92309e34e42aec3a0e041403bdd3c4fc0dc20269 Component: engine