Skip to content

Commit 163e343

Browse files
cfsmp3claude
andcommitted
fix: Prevent queue_test from overwriting completed test status
When multiple GitHub Actions workflows complete for the same commit, the webhook handler was calling queue_test() for all platforms, even if a test had already started or completed. This caused the GitHub status to be overwritten from "All tests passed" back to "Tests queued". Timeline of the bug: 1. Linux build completes → queue_test(linux) → "Tests queued" 2. Linux test completes → "All tests passed" (SUCCESS) 3. Windows build completes → queue_test(linux) called again → "Tests queued" overwrites the SUCCESS status! Fix: Check if test already has progress before posting "Tests queued". If the test has any progress entries, skip the status update. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 1e2e20a commit 163e343

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

mod_ci/controllers.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,6 +1321,14 @@ def queue_test(gh_commit: Commit.Commit, commit, test_type, platform, branch="ma
13211321
add_customized_regression_tests(platform_test.id)
13221322

13231323
if gh_commit is not None:
1324+
# Check if test already has progress (started or completed)
1325+
# If so, don't overwrite the GitHub status with "Tests queued"
1326+
# This prevents the bug where a completed test gets its status overwritten
1327+
# when a later webhook triggers queue_test for the same commit
1328+
if len(platform_test.progress) > 0:
1329+
log.info(f"Test {platform_test.id} already has progress, not posting 'Tests queued' status")
1330+
return
1331+
13241332
target_url = url_for('test.by_id', test_id=platform_test.id, _external=True)
13251333
status_context = f"CI - {platform_test.platform.value}"
13261334
update_status_on_github(gh_commit, Status.PENDING, "Tests queued", status_context, target_url)

0 commit comments

Comments
 (0)