move the assertions outside of the goroutine Upstream-commit: 5c88a6fdcaa264845e5ad07f57222f750e213520 Component: engine