uranusjr commented on a change in pull request #18575: URL: https://github.com/apache/airflow/pull/18575#discussion_r720782683
########## File path: tests/models/test_dagbag.py ########## @@ -801,6 +802,32 @@ def _sync_to_db(): _sync_to_db() mock_sync_perm_for_dag.assert_called_once_with(dag, session=session) + def test_sync_to_db_dag_specific_perms_failure(self, caplog): + """ + Test that errors during dagbag.sync_to_db, specifically syncing DAG specific permissions, are logged + and added to import_errors every parsing cycle + """ + with create_session() as session, NamedTemporaryFile( + dir=self.empty_dir, suffix=".py" + ) as f, freeze_time(tz.datetime(2020, 1, 5, 0, 0, 0)) as frozen_time: + f.write(b'from airflow import DAG\n') + f.write(b'd = DAG(dag_id="access_control_test", access_control={"FakeRole": {"can_read"}})') + f.flush() + + for i in [0, 60]: Review comment: ```suggestion for i in range(60): ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org