Fix race condition in API commit test Upstream-commit: b5ccfca565fae04dc2f95160e0c99925b79c4e13 Component: engine