From d45a77ca72f78ff3874a8c217d9efd0e3a7399d0 Mon Sep 17 00:00:00 2001 From: Carlos Date: Sun, 28 Dec 2025 13:24:03 +0100 Subject: [PATCH] fix: Prevent queue_test from overwriting completed test status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When multiple GitHub Actions workflows complete for the same commit, the webhook handler calls queue_test() for all platforms. This caused completed tests to have their GitHub status overwritten from SUCCESS back to "Tests queued". Example timeline: 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 started or completed, skip the GitHub status update. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- mod_ci/controllers.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mod_ci/controllers.py b/mod_ci/controllers.py index 2b5b1169..8b5fe5e4 100755 --- a/mod_ci/controllers.py +++ b/mod_ci/controllers.py @@ -1305,6 +1305,14 @@ def queue_test(gh_commit: Commit.Commit, commit, test_type, platform, branch="ma add_customized_regression_tests(platform_test.id) if gh_commit is not None: + # Check if test already has progress (started or completed) + # If so, don't overwrite the GitHub status with "Tests queued" + # This prevents the bug where a completed test gets its status overwritten + # when a later webhook triggers queue_test for the same commit + if len(platform_test.progress) > 0: + log.info(f"Test {platform_test.id} already has progress, not posting 'Tests queued' status") + return + target_url = url_for('test.by_id', test_id=platform_test.id, _external=True) status_context = f"CI - {platform_test.platform.value}" update_status_on_github(gh_commit, Status.PENDING, "Tests queued", status_context, target_url)