mobuchowski commented on code in PR #39890:
URL: https://github.com/apache/airflow/pull/39890#discussion_r1636631128


##########
tests/listeners/very_slow_listener.py:
##########
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import time
+
+from airflow.listeners import hookimpl
+
+
+@hookimpl
+def on_task_instance_success(previous_state, task_instance, session):
+    time.sleep(30)

Review Comment:
   Tried to naively use `frozen_sleep` and I don't think it plays nice with 
heartbeat mechanism. 
   
   ```
   INFO     
airflow.jobs.local_task_job_runner.LocalTaskJobRunner:local_task_job_runner.py:122
 ::group::Pre task execution logs
   INFO     airflow.jobs.job.Job:job.py:225 Heartbeat recovered after 420.04 
seconds
   INFO     airflow.jobs.job.Job:job.py:225 Heartbeat recovered after 750.01 
seconds
   INFO     airflow.jobs.job.Job:job.py:225 Heartbeat recovered after 665.00 
seconds
   INFO     airflow.jobs.job.Job:job.py:225 Heartbeat recovered after 560.00 
seconds
   INFO     airflow.jobs.job.Job:job.py:225 Heartbeat recovered after 330.00 
seconds
   INFO     airflow.jobs.job.Job:job.py:225 Heartbeat recovered after 220.00 
seconds
   INFO     airflow.jobs.job.Job:job.py:225 Heartbeat recovered after 345.00 
seconds
   INFO     airflow.jobs.job.Job:job.py:225 Heartbeat recovered after 360.00 
seconds
   INFO     airflow.jobs.job.Job:job.py:225 Heartbeat recovered after 460.01 
seconds
   INFO     airflow.jobs.job.Job:job.py:225 Heartbeat recovered after 2170.02 
seconds
   ERROR    
airflow.jobs.local_task_job_runner.LocalTaskJobRunner:local_task_job_runner.py:215
 Heartbeat time limit exceeded!
   INFO     
airflow.jobs.local_task_job_runner.LocalTaskJobRunner:local_task_job_runner.py:223
 ::endgroup::
   ```
   
   However, got it down to `51.44s`.



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