def test_evaluator_error_handling(self) -> None:
        """Test that evaluator handles errors gracefully."""
        # Create a mock app that raises an error when compute_feedbacks is
        # called.
        mock_app = MagicMock()
        mock_app.app_name = "Error App"
        mock_app.app_version = "v1"
        mock_app.app_id = "error_app_id"
        mock_app.compute_feedbacks.side_effect = Exception("Test error")
        # Create test data
        test_events = pd.DataFrame([
            {
                "trace": {"span_id": "span1", "parent_id": None},
                "record_attributes": {
                    SpanAttributes.SPAN_TYPE: SpanAttributes.SpanType.RECORD_ROOT,
                    SpanAttributes.RECORD_ID: "test_record_id",
                },
            }
        ])
        # Mock the connector to return test events.
        mock_app.connector.get_events.return_value = test_events
        # Start evaluator.
        evaluator = Evaluator(mock_app)
        evaluator.start_evaluator()
        time.sleep(1)
        # Verify compute_feedbacks was called even though it raised an error.
        mock_app.compute_feedbacks.assert_called()
Test that evaluator handles errors gracefully.
tests/unit/test_otel_evaluator.py