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
self, mock_delete_pod, mock_get_kube_client, mock_kubernetes_job_watcher
    ):
        executor = self.kubernetes_executor
        executor.kube_config.delete_worker_pods_on_failure = True
        executor.start()
        key = ('dag_id', 'task_id', 'ex_time', 'try_number2')
        executor._change_state(key, State.FAILED, 'pod_id', 'test-namespace')
        assert executor.event_buffer[key][0] == State.FAILED
        mock_delete_pod.assert_called_once_with('pod_id', 'test-namespace')
    @mock.patch('airflow.executors.kubernetes_executor.KubernetesExecutor.adopt_launched_task')
    @mock.patch('airflow.executors.kubernetes_executor.KubernetesExecutor._adopt_completed_pods')
    def test_try_adopt_task_instances(self, mock_adopt_completed_pods, mock_adopt_launched_task):
        executor = self.kubernetes_executor
        executor.scheduler_job_id = "10"
        ti_key = annotations_to_key(
            {
                'dag_id': 'dag',
                'execution_date': datetime.utcnow().isoformat(),
                'task_id': 'task',
                'try_number': '1',
            }
        )