Skip to content

Commit e7f666b

Browse files
cfsmp3claude
andcommitted
fix: Add retry logic to final GitHub status update
The final GitHub status update in progress_type_request() was not using retry logic, causing tests to complete but remain stuck in "pending" state on GitHub if the status update failed (e.g., due to rate limiting or network issues). This is the same fix applied to mark_test_failed() in PR #976, now applied to the normal test completion path. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 58cd57b commit e7f666b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

mod_ci/controllers.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,8 +1933,16 @@ def progress_type_request(log, test, test_id, request) -> bool:
19331933
else:
19341934
message = progress.message
19351935

1936-
gh_commit = repository.get_commit(test.commit)
1937-
update_status_on_github(gh_commit, state, message, context, target_url=target_url)
1936+
# Use retry logic for final GitHub status update to prevent stuck "pending" states
1937+
# This is critical - if this fails, the PR will show "Tests queued" forever
1938+
try:
1939+
def update_final_status():
1940+
gh_commit = repository.get_commit(test.commit)
1941+
update_status_on_github(gh_commit, state, message, context, target_url=target_url)
1942+
1943+
retry_with_backoff(update_final_status, max_retries=3, initial_backoff=2.0)
1944+
except Exception as e:
1945+
log.error(f"Test {test_id}: Failed to update final GitHub status after retries: {e}")
19381946

19391947
if status in [TestStatus.completed, TestStatus.canceled]:
19401948
# Delete the current instance

0 commit comments

Comments
 (0)