You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/05/14 14:24:30 UTC

[GitHub] [airflow] turbaszek commented on a change in pull request #8871: Don't use ProcessorAgent to test ProcessorManager

turbaszek commented on a change in pull request #8871:
URL: https://github.com/apache/airflow/pull/8871#discussion_r425177568



##########
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

Review comment:
       ```suggestion
                   if isinstance(obj, DagParsingStat) and obj.done:
                       return results
   ```
   This should please pylint




----------------------------------------------------------------
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:
users@infra.apache.org