Skip to content

ci(windows): make the ffmpeg retry test the outcome, not choco's exit code - #1290

Merged
debpalash merged 4 commits into
mainfrom
fix/ci-choco-retry-checks-outcome
Jul 29, 2026
Merged

ci(windows): make the ffmpeg retry test the outcome, not choco's exit code#1290
debpalash merged 4 commits into
mainfrom
fix/ci-choco-retry-checks-outcome

Conversation

@debpalash

@debpalash debpalash commented Jul 28, 2026

Copy link
Copy Markdown
Owner

This is what just took #1281 red on an unrelated change.

What happened

The chocolatey community feed returned 503. choco install ffmpeg printed:

Unable to find package 'ffmpeg'. Existing packages must be restored before ...
Chocolatey installed 0/0 packages.

…and exited 0.

The retry loop added on 2026-07-20 for exactly this class was written as choco install ... && break. It broke out on the first attempt, no backoff ran, and the job died one line later on ffmpeg: command not found. The log proves it: no choco attempt 1 failed line, no 30s gap.

A retry that trusts a lying exit code is not a retry.

Fix

Test the outcome — command -v ffmpeg — instead of $?. Same 3 attempts, same backoff, but the loop exits only when ffmpeg is genuinely on PATH, and still fails the job loudly when it never arrives (a silent pass would push a broken toolchain into the test run).

Tests

tests/test_ci_windows_ffmpeg_retry.py extracts the real step body from ci.yml (so it cannot drift) and runs it against a stubbed choco:

Case Expected
exit 0 + nothing installed retries (the regression)
ordinary non-zero failure retries
never installs job fails after 3 attempts
first attempt works exactly 1 attempt, no wasted backoff

2 of the 4 fail against the previous loop.

One harness note worth keeping: the test pins a minimal PATH. Inheriting the developer's let a real /opt/homebrew/bin/ffmpeg satisfy command -v and silently neuter every assertion — which it did, on my first run.

Updated the Windows CI dependency-install smoke job to use a per-OS timeout budget (Windows 25 minutes vs 10 for others) and changed the Windows ffmpeg install retry loop to retry based on command -v ffmpeg (with hash -r and up to three attempts/backoff) instead of Chocolatey’s exit code, which could falsely report success. Added regression tests that extract and execute the exact System deps (Windows) step from ci.yml with stubbed choco, sleep, and a pinned PATH so they exercise false-success, non-zero failure, persistent failure, and first-attempt success—including verifying there’s no backoff announcement after the final attempt. Human review is most important around the hash -r + command -v ffmpeg control flow and the test harness’s PATH isolation to ensure a real system ffmpeg can’t mask failures.

… code

The chocolatey feed 503'd; choco printed "Unable to find package 'ffmpeg'"
and "installed 0/0 packages" — then exited 0. The retry loop added on
2026-07-20 for this exact class was `choco install ... && break`, so it broke
out on attempt 1, no backoff ran, and the job died one line later on
`ffmpeg: command not found`. It took #1281 red on an unrelated change.

A retry that trusts a lying exit code is not a retry. The loop now exits on
`command -v ffmpeg` and still fails the job loudly when ffmpeg never arrives.

Tests extract the real step body from ci.yml and run it against a stubbed
choco; 2 of the 4 fail against the previous loop.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9b52c18a-5986-4b69-b4c8-fd5be61344e8

📥 Commits

Reviewing files that changed from the base of the PR and between 658cfd0 and b66b27a.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • tests/test_ci_windows_ffmpeg_retry.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/ci.yml
  • tests/test_ci_windows_ffmpeg_retry.py

📝 Walkthrough

Walkthrough

Changes

Windows ffmpeg retry

Layer / File(s) Summary
Verify ffmpeg after Chocolatey installation
.github/workflows/ci.yml
The Windows CI loop now checks for ffmpeg after each Chocolatey attempt, retries when the executable is absent, and gives Windows matrix legs a 25-minute timeout while other operating systems retain 10 minutes.
Exercise workflow retry scenarios
tests/test_ci_windows_ffmpeg_retry.py
Tests extract the workflow command and cover false-success, failure, exhaustion, sandbox isolation, and first-attempt installation cases.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 8 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the fix and tests, but it does not follow the required template sections for Summary, Changes, Type, Checklist, or Release cadence. Rewrite the PR body to match the template with all required headings, fill the Type and Testing sections, and complete the checklist.
✅ Passed checks (8 passed)
Check name Status Explanation
Title check ✅ Passed The title uses conventional-commit style with a scope and accurately reflects the CI ffmpeg retry fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cross-Platform Default Parity ✅ Passed PASS: The PR only changes CI workflow/test harness; no user-facing default behavior or platform-only feature was added.
I18n Completeness (21 Locales) ✅ Passed No frontend files changed in this PR, so there are no new/changed t('...') keys or hardcoded UI strings to audit.
Local-First Guarantee ✅ Passed Only a CI workflow and a local test changed; no app code, API keys, telemetry, or new runtime cloud calls were added.
Backward Compatibility ✅ Passed PR only changes CI workflow and a test; no runtime schema, omnivoice_data, migration, or engine/model-loading code was touched.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 310-314: Update the ffmpeg installation retry loop so the retry
message and backoff sleep execute only when i is less than 3; after the final
failed attempt, exit the loop without logging a retry or sleeping.

In `@tests/test_ci_windows_ffmpeg_retry.py`:
- Around line 96-103: Update test_retries_when_choco_lies_about_success to
assert attempts == 2 instead of allowing any value greater than or equal to two,
ensuring the retry loop stops immediately once ffmpeg is installed on the second
attempt while preserving the successful process return-code assertion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b0dda601-99cd-49e5-a3de-8815f19e0849

📥 Commits

Reviewing files that changed from the base of the PR and between 574b283 and 349f46e.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • tests/test_ci_windows_ffmpeg_retry.py

Comment thread .github/workflows/ci.yml
Comment thread tests/test_ci_windows_ffmpeg_retry.py
@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR hardens Windows CI dependency setup.

  • Verifies that ffmpeg is actually available before ending the Chocolatey retry loop.
  • Assigns the Windows smoke job a longer timeout while retaining shorter macOS and Linux limits.
  • Adds regression coverage for successful, failed, false-success, and exhausted ffmpeg installations.

Important Files Changed

Filename Overview
.github/workflows/ci.yml Updates the Windows ffmpeg retry condition and introduces per-platform smoke-job timeouts without an eligible merge-blocking issue.
tests/test_ci_windows_ffmpeg_retry.py Adds an isolated POSIX test harness that executes the workflow step and verifies retry and failure behavior.

Reviews (4): Last reviewed commit: "ci(windows): skip the backoff after the ..." | Re-trigger Greptile

debpalash and others added 3 commits July 28, 2026 23:33
The harness inherited the ambient PATH, so a real ffmpeg satisfied
`command -v` and the loop exited on attempt 1 — every assertion passed
against a broken workflow. It happened twice: /opt/homebrew/bin locally, then
/usr/bin on the Linux runner, which is what took this PR red.

PATH is now the stub dir alone, with the few real tools the stubs need
symlinked in, and stub shebangs are absolute (`/usr/bin/env bash` cannot
resolve bash when PATH is one directory). test_harness_actually_hides_ffmpeg
asserts the sandbox is a sandbox, so the next leak fails loudly instead of
quietly passing.

2 of 5 fail against the old `&& break` loop.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Smoke (Windows) has been dying at 10m08s inside `uv sync`, and the shared
10-minute budget made it self-perpetuating: the leg is killed before the
post-step saves the uv cache, so the next run starts cold and dies the same
way. Nothing primes the cache, so it never gets faster.

Measured on run 30385710466 — Linux 65s, macOS 65s, Windows still installing
torch when the job was killed. Windows now gets 25 minutes, priced for one
cold install to finish and populate the cache; warm runs land nowhere near it.

Per-leg rather than raising the shared value, so a genuine hang on Linux or
macOS still fails fast instead of inheriting Windows' allowance.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
CodeRabbit, both valid:

- The loop announced "retrying in 90s" and slept after attempt 3, though no
  fourth attempt exists — 90s added to an already-doomed job.
- The retry tests asserted `attempts >= N`, so a regression that kept going
  after ffmpeg appeared would still pass. Pinned to exact counts, plus a case
  asserting the final attempt announces no retry.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@debpalash
debpalash merged commit 3553965 into main Jul 29, 2026
16 checks passed
@debpalash
debpalash deleted the fix/ci-choco-retry-checks-outcome branch July 29, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant