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

hello-stephen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new f30f7e527a8 [fix](ci) Extend capacity recovery to six five-minute 
retries (#68567)
f30f7e527a8 is described below

commit f30f7e527a80a479020434ba739864bf629cb09e
Author: shuke <[email protected]>
AuthorDate: Mon Sep 28 18:29:05 2026 +0800

    [fix](ci) Extend capacity recovery to six five-minute retries (#68567)
    
    ### What problem does this PR solve?
    
    Related PR: #68547
    
    Recent automated reviews exhausted all three capacity resumes while
    substantial time remained in the shared review budget. The current waits
    are 30, 60, and 120 seconds.
    
    Use six same-session capacity retries with a fixed 300-second wait
    before each retry. This permits the initial attempt plus six resumes,
    with up to 30 minutes of explicit waiting inside the existing review
    deadline.
    
    The existing capacity classification, PR base/head validation,
    duplicate-review protection, cancellation handling, and shared deadline
    continue to govern every attempt.
---
 .github/scripts/run_review_with_resume.py      |  3 +-
 .github/scripts/test_run_review_with_resume.py | 55 +++++++++++++++-----------
 2 files changed, 33 insertions(+), 25 deletions(-)

diff --git a/.github/scripts/run_review_with_resume.py 
b/.github/scripts/run_review_with_resume.py
index eb6edb767fa..a6176cb3616 100755
--- a/.github/scripts/run_review_with_resume.py
+++ b/.github/scripts/run_review_with_resume.py
@@ -32,7 +32,8 @@ import uuid
 from datetime import datetime, timezone
 from pathlib import Path
 
-RETRY_DELAYS = (30, 60, 120)
+# Six same-session capacity retries, each after a fixed five-minute wait.
+RETRY_DELAYS = (300,) * 6
 CAPACITY_MESSAGE = "Selected model is at capacity. Please try a different 
model."
 UNSUPPORTED_CHATGPT_MODEL = "model is not supported when using Codex with a 
ChatGPT account."
 PROCESS_EXIT_GRACE_SECONDS = 5
diff --git a/.github/scripts/test_run_review_with_resume.py 
b/.github/scripts/test_run_review_with_resume.py
index 01c49eaf4e8..352f29b423c 100755
--- a/.github/scripts/test_run_review_with_resume.py
+++ b/.github/scripts/test_run_review_with_resume.py
@@ -259,7 +259,7 @@ class ResumeReviewTest(unittest.TestCase):
                 ]
             ),
         )
-        self.assertEqual([30], self.sleeps)
+        self.assertEqual([300], self.sleeps)
         self.assertEqual(
             ["gpt-6-sol", "gpt-5.6-sol", "gpt-5.6-sol"],
             [command[command.index("--model") + 1] for command in 
self.commands],
@@ -286,7 +286,7 @@ class ResumeReviewTest(unittest.TestCase):
             ),
         )
         self.assertEqual(2, len(self.commands))
-        self.assertEqual([30], self.sleeps)
+        self.assertEqual([300], self.sleeps)
         self.assertEqual(rejection, self.last_error())
 
     def 
test_capacity_resumes_exact_session_with_same_settings_and_ledger(self):
@@ -308,8 +308,8 @@ class ResumeReviewTest(unittest.TestCase):
                 ]
             ),
         )
-        self.assertEqual([30], self.sleeps)
-        self.assertEqual([1000, 965], self.timeouts)
+        self.assertEqual([300], self.sleeps)
+        self.assertEqual([1000, 695], self.timeouts)
         command = self.commands[1]
         self.assertEqual(["resume", THREAD], command[-3:-1])
         self.assertNotIn("--last", command)
@@ -323,28 +323,34 @@ class ResumeReviewTest(unittest.TestCase):
         self.assertEqual("done", (self.context / 
"codex-final-message.txt").read_text())
         self.target_check.assert_called_once()
 
-    def test_zero_exit_capacity_on_resume_still_retries(self):
+    def test_zero_exit_capacity_can_complete_on_the_sixth_resume(self):
+        self.args.budget_seconds = 3600
         self.assertEqual(
             0,
             self.execute(
-                [
-                    {"events": [thread_event(), failed()]},
-                    {"events": [thread_event(), failed()], "status": 0},
-                    {"events": [thread_event(), completed()], "status": 0},
-                ]
+                [{"events": [thread_event(), failed()]}]
+                + [{"events": [thread_event(), failed()], "status": 0}] * 5
+                + [{"events": [thread_event(), completed()], "status": 0}]
             ),
         )
-        self.assertEqual(3, len(self.commands))
-        self.assertEqual([30, 60], self.sleeps)
-        self.assertEqual(2, self.target_check.call_count)
+        self.assertEqual(7, len(self.commands))
+        self.assertEqual([300] * 6, self.sleeps)
+        self.assertEqual([3600, 3300, 3000, 2700, 2400, 2100, 1800], 
self.timeouts)
+        self.assertEqual(6, self.target_check.call_count)
+        for command in self.commands[1:]:
+            self.assertEqual(["resume", THREAD], command[-3:-1])
+        retries = [e for e in self.events() if e["type"] == 
"review.capacity_retry"]
+        self.assertEqual([2, 3, 4, 5, 6, 7], [e["next_attempt"] for e in 
retries])
+        self.assertEqual([300] * 6, [e["delay_seconds"] for e in retries])
         self.assertEqual("completed", 
exporter.latest_turn_result(self.events())[0])
 
     def test_zero_exit_capacity_stops_at_the_retry_limit(self):
+        self.args.budget_seconds = 3600
         self.assertEqual(
-            1, self.execute([{"events": [thread_event(), failed()], "status": 
0}] * 4)
+            1, self.execute([{"events": [thread_event(), failed()], "status": 
0}] * 7)
         )
-        self.assertEqual([30, 60, 120], self.sleeps)
-        self.assertEqual(4, len(self.commands))
+        self.assertEqual([300] * 6, self.sleeps)
+        self.assertEqual(7, len(self.commands))
         self.assertEqual(runner.CAPACITY_MESSAGE, self.last_error())
 
     def test_zero_exit_error_event_can_identify_capacity(self):
@@ -363,7 +369,7 @@ class ResumeReviewTest(unittest.TestCase):
                 ]
             ),
         )
-        self.assertEqual([30], self.sleeps)
+        self.assertEqual([300], self.sleeps)
 
     def test_zero_exit_auth_usage_and_generic_failures_do_not_retry(self):
         for message in (
@@ -403,7 +409,7 @@ class ResumeReviewTest(unittest.TestCase):
             ),
         )
         self.assertEqual(2, len(self.commands))
-        self.assertEqual([30], self.sleeps)
+        self.assertEqual([300], self.sleeps)
         self.assertIn("without a terminal turn event", self.last_error())
         self.assertNotEqual(runner.CAPACITY_MESSAGE, self.last_error())
 
@@ -467,9 +473,10 @@ class ResumeReviewTest(unittest.TestCase):
         self.assertEqual([], self.sleeps)
 
     def test_retry_count_is_bounded(self):
-        self.assertEqual(1, self.execute([{"events": [thread_event(), 
failed()]}] * 4))
-        self.assertEqual([30, 60, 120], self.sleeps)
-        self.assertEqual(4, len(self.commands))
+        self.args.budget_seconds = 3600
+        self.assertEqual(1, self.execute([{"events": [thread_event(), 
failed()]}] * 7))
+        self.assertEqual([300] * 6, self.sleeps)
+        self.assertEqual(7, len(self.commands))
         self.assertEqual(runner.CAPACITY_MESSAGE, self.last_error())
 
     def 
test_no_retry_for_auth_usage_or_generic_errors_even_before_session_starts(self):
@@ -555,7 +562,7 @@ class ResumeReviewTest(unittest.TestCase):
         self.assertEqual([], self.sleeps)
 
     def test_budget_is_not_reset_between_attempts(self):
-        self.args.budget_seconds = 100
+        self.args.budget_seconds = 400
         self.assertEqual(
             1,
             self.execute(
@@ -565,8 +572,8 @@ class ResumeReviewTest(unittest.TestCase):
                 ]
             ),
         )
-        self.assertEqual([100, 60], self.timeouts)
-        self.assertEqual([30], self.sleeps)
+        self.assertEqual([400, 90], self.timeouts)
+        self.assertEqual([300], self.sleeps)
         self.assertIn("Insufficient shared review budget", self.last_error())
 
     def test_normal_review_can_run_past_the_old_89_minute_limit(self):


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to