When setting DockerOperator with auto_remove=True in airflow version 2.0.0 the container remain in the container list if it was finished with 'Exited (1)'
tests/providers/docker/operators/test_docker.py
self.client_mock.attach.return_value = ['unicode container log 😁']
        originalRaiseExceptions = logging.raiseExceptions  # p
        logging.raiseExceptions = True
        operator = DockerOperator(image='ubuntu', owner='unittest', task_id='unittest')
        with mock.patch('traceback.print_exception') as print_exception_mock:
            operator.execute(None)
            logging.raiseExceptions = originalRaiseExceptions
            print_exception_mock.assert_not_called()
    def test_execute_container_fails(self):
        self.client_mock.wait.return_value = {"StatusCode": 1}
        operator = DockerOperator(image='ubuntu', owner='unittest', task_id='unittest')
        with pytest.raises(AirflowException):
            operator.execute(None)
    @staticmethod
    def test_on_kill():
        client_mock = mock.Mock(spec=APIClient)
        operator = DockerOperator(image='ubuntu', owner='unittest', task_id='unittest')
        operator.cli = client_mock
        operator.container = {'Id': 'some_id'}
        operator.on_kill()
        client_mock.stop.assert_called_once_with('some_id')
    def test_execute_no_docker_conn_id_no_hook(self):