Fix hanging on tests failing Upstream-commit: 05c3325a02bf2ffee660dcfd36e8d34cb7192b51 Component: engine