ashb commented on a change in pull request #16301:
URL: https://github.com/apache/airflow/pull/16301#discussion_r677261506



##########
File path: tests/jobs/test_local_task_job.py
##########
@@ -544,10 +535,53 @@ def test_process_kill_calls_on_failure_callback(self, 
signal_type, dag_maker):
         def failure_callback(context):
             with shared_mem_lock:
                 failure_callback_called.value += 1
-            assert context['dag_run'].dag_id == 'test_mark_failure'
+            assert context['dag_run'].dag_id == 'test_send_sigkill'
 
         def task_function(ti):
+            # pylint: disable=unused-argument
+            time.sleep(1)
+            os.kill(ti.pid, signal.SIGKILL)
+            # This should not happen -- the state change should be noticed and 
the task should get killed
+            with shared_mem_lock:
+                task_terminated_externally.value = 0
+
+        with dag_maker(dag_id='test_send_sigkill', start_date=DEFAULT_DATE, 
default_args={'owner': 'owner1'}):

Review comment:
       ```suggestion
           with dag_maker(dag_id='test_send_sigkill'):
   ```




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to