This is an automated email from the ASF dual-hosted git repository.

vatsrahul1001 pushed a commit to branch v3-3-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-3-test by this push:
     new 319b211218a [v3-3-test] Add regression test for SERVER_TERMINATED 
precedence over retry (#70774) (#71066)
319b211218a is described below

commit 319b211218af689c96d7d9b0df5abe7a379006d4
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Aug 4 19:39:38 2026 +0530

    [v3-3-test] Add regression test for SERVER_TERMINATED precedence over retry 
(#70774) (#71066)
    
    (cherry picked from commit b99aa145c400d204aa72e84a05e5691136e28e46)
    
    Co-authored-by: Henry Chen <[email protected]>
---
 .../tests/task_sdk/execution_time/test_supervisor.py    | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/task-sdk/tests/task_sdk/execution_time/test_supervisor.py 
b/task-sdk/tests/task_sdk/execution_time/test_supervisor.py
index 5928b4582e5..fd4ba9703bd 100644
--- a/task-sdk/tests/task_sdk/execution_time/test_supervisor.py
+++ b/task-sdk/tests/task_sdk/execution_time/test_supervisor.py
@@ -161,6 +161,7 @@ from airflow.sdk.execution_time.comms import (
     _ResponseFrame,
 )
 from airflow.sdk.execution_time.supervisor import (
+    SERVER_TERMINATED,
     ActivitySubprocess,
     InProcessSupervisorComms,
     InProcessTestSupervisor,
@@ -3845,6 +3846,22 @@ class TestSignalRetryLogic:
 
         assert mock_watched_subprocess.final_state == 
TaskInstanceState.UP_FOR_RETRY
 
+    def test_server_terminated_takes_precedence_over_retry(self, mocker):
+        """Test that a server-terminated task stays SERVER_TERMINATED even 
with retries enabled."""
+        mock_watched_subprocess = ActivitySubprocess(
+            process_log=mocker.MagicMock(),
+            id=TI_ID,
+            pid=12345,
+            stdin=mocker.Mock(),
+            process=mocker.Mock(),
+            client=mocker.Mock(),
+        )
+        mock_watched_subprocess._exit_code = 1
+        mock_watched_subprocess._should_retry = True
+        mock_watched_subprocess._terminal_state = SERVER_TERMINATED
+
+        assert mock_watched_subprocess.final_state == SERVER_TERMINATED
+
     def test_non_signal_exit_code_without_retry_goes_to_failed(self, mocker):
         """Test that non-signal exit codes without retries enabled go to 
FAILED."""
         mock_watched_subprocess = ActivitySubprocess(

Reply via email to