Fix race in test registry setup Upstream-commit: fcdfc8ccc86044f06da0b47dc028894fe3ea25f9 Component: engine