kaxil commented on a change in pull request #15112:
URL: https://github.com/apache/airflow/pull/15112#discussion_r605056899
##########
File path: tests/utils/test_dag_processing.py
##########
@@ -521,17 +523,93 @@ def test_dag_with_system_exit(self):
manager._run_parsing_loop()
+ result = None
while parent_pipe.poll(timeout=None):
result = parent_pipe.recv()
if isinstance(result, DagParsingStat) and result.done:
break
# Three files in folder should be processed
- assert len(result.file_paths) == 3
+ assert result.num_file_paths == 3
with create_session() as session:
assert session.query(DagModel).get(dag_id) is not None
+ @conf_vars({('core', 'load_examples'): 'False'})
+ @pytest.mark.backend("mysql", "postgres")
+ def test_pipe_full_deadlock(self):
+ dag_filepath = TEST_DAG_FOLDER / "test_scheduler_dags.py"
+
+ child_pipe, parent_pipe = multiprocessing.Pipe()
+
+ # Shrink the buffers to exacerbate the problem!
+ for fd in (parent_pipe.fileno(),):
+ sock = socket.socket(fileno=fd)
+ sock.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 1024)
+ sock.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 1024)
+ sock.detach()
+
+ exit_event = threading.Event()
+
+ # To test this behaviour we need something that continually fills the
+ # parent pipe's bufffer (and keeps it full).
+ def keep_pipe_full(pipe, exit_event):
+ import logging
Review comment:
and this too
--
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]