ashb commented on a change in pull request #8871:
URL: https://github.com/apache/airflow/pull/8871#discussion_r425184513
##########
File path: tests/utils/test_dag_processing.py
##########
@@ -85,6 +87,23 @@ class TestDagFileProcessorManager(unittest.TestCase):
def setUp(self):
clear_db_runs()
+ def run_processor_manager_one_loop(self, manager, parent_pipe):
+ if not manager._async_mode:
+ parent_pipe.send(DagParsingSignal.AGENT_RUN_ONCE)
+
+ results = []
+
+ while True: # pylint: disable=too-many-nested-blocks
+ manager._run_parsing_loop()
+
+ while parent_pipe.poll(timeout=0.01):
+ obj = parent_pipe.recv()
+ if isinstance(obj, DagParsingStat):
+ if obj.done:
+ return results
+ continue
+ results.append(obj)
Review comment:
Yes okay, I was being lazy :)
Would please plyint, but you've inverted one case.
```python
if not isinstance(obj, DagParsingStat):
results.append(obj)
elif obj.done:
return results
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]