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 2021/04/28 21:00:19 UTC

[GitHub] [airflow] jedcunningham commented on a change in pull request #15537: Fix on_failure_callback when task receive SIGKILL

jedcunningham commented on a change in pull request #15537:
URL: https://github.com/apache/airflow/pull/15537#discussion_r622539294



##########
File path: tests/jobs/test_local_task_job.py
##########
@@ -547,18 +550,83 @@ def task_function(ti):
         process = multiprocessing.Process(target=job1.run)
         process.start()
 
-        for _ in range(0, 10):
+        for _ in range(0, 20):
             ti.refresh_from_db()
-            if ti.state == State.RUNNING:
+            if ti.state == State.RUNNING and ti.pid is not None:
                 break
             time.sleep(0.2)
         assert ti.state == State.RUNNING
+        assert ti.pid is not None
         os.kill(ti.pid, signal.SIGTERM)
         process.join(timeout=10)
         assert failure_callback_called.value == 1
         assert task_terminated_externally.value == 1
         assert not process.is_alive()
 
+    def test_process_sigkill_call_on_failure_callback(self):
+        """
+        Test that ensures that when a task is killed with sigterm

Review comment:
       ```suggestion
           Test that ensures that when a task is killed with sigkill
   ```
   
   Should be sigkill, right?




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