Add cycle check to tests