The Kubernetes executor has surprisingly low test coverage: 64% 

https://codecov.io/gh/apache/airflow/src/master/airflow/executors/kubernetes_executor.py - looks like some of the "flush/end" code is not tested.

We might want to improve it.
tests/executors/test_kubernetes_executor.py
current_folder = pathlib.Path(__file__).parent.absolute()
        template_file = str(
            (current_folder / "kubernetes_executor_template_files" / "basic_template.yaml").absolute()
        )
        mock_kube_client = mock.patch('kubernetes.client.CoreV1Api', autospec=True)
        mock_get_kube_client.return_value = mock_kube_client
        with conf_vars({('kubernetes', 'pod_template_file'): ''}):
            executor = self.kubernetes_executor
            executor.start()
            assert executor.event_buffer == {}
            assert executor.task_queue.empty()
            execution_date = datetime.utcnow()
            executor.execute_async(
                key=('dag', 'task', execution_date, 1),
                queue=None,
                command=['airflow', 'tasks', 'run', 'true', 'some_parameter'],
                executor_config={
                    "pod_template_file": template_file,
                    "pod_override": k8s.V1Pod(
                        metadata=k8s.V1ObjectMeta(labels={"release": "stable"}),
                        spec=k8s.V1PodSpec(
                            containers=[k8s.V1Container(name="base", image="airflow:3.6")],
                        ),
                    ),
                },