Skip to content

Allow for audio padding in the hook length check - #290

Merged
nmbrthirteen merged 3 commits into
mainfrom
fix-hook-duration-test
Nov 23, 2026
Merged

nmbrthirteen merged 3 commits into
mainfrom
fix-hook-duration-test

Conversation

@nmbrthirteen

@nmbrthirteen nmbrthirteen commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

What this does

test_move_plays_the_hook_first_and_drops_it_from_the_body fails on the Windows runner (and on a re-run of main): the reported length is 6.13s against an expected 6.0s within 0.1s.

The test adds up three parts. Its own comment says each part can round up to a whole frame, and the video length check allows three frames (3 / 25 = 0.12s). The reported length held to 0.1s is the sum of each part's container duration, which can also include audio padding past the last frame, so the same rounding leaves it about 0.01s over three frames. The reported length now gets three frames plus 0.05s. The video length, frame colors, tone and word timing assertions are unchanged.

How I tested it

The failing Windows job on #286, #287 and #288 reports 6.13 != 6.0 within 0.1. This PR's Windows job is the check.

Checklist

  • npx tsc --noEmit and npm test pass (plus pytest tests/ if you touched the backend)
  • Docs updated if commands or behavior changed
  • No secrets, personal config, or generated output committed

Summary by CodeRabbit

  • Tests
    • Adjusted render-test timing tolerances to account for frame rounding, audio padding, and caption timing.

The move-hook test adds up three parts. Its comment says each can round up
to a whole frame, and the video length check allows three frames, but the
reported length was held to 0.1s. That length sums each part's container
duration, which can also carry audio padding past its last frame, so the
Windows runner's 6.13s against 6.0s failed. The reported length now gets the
same three frames plus 0.05s.
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The opening-hook render tests now support configurable word-start timing tolerance. The move-mode test uses wider tolerances for reported duration and word-start timing.

Changes: Render test timing tolerances

Layer / File(s) Summary
Adjust render timing assertions
tests/test_opening_hook.py
_assert_words accepts a delta value, defaulting to 0.05 seconds. The move-mode test allows a duration tolerance of 3 / FPS + 0.05 and passes delta=0.15 for word-start comparisons.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Merge Risk: Minimal · up to b7fb3

This change loosens timing tolerances in a render test so it stops failing on Windows because of audio padding. It does not change product behavior, and the merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Allow for audio padding in the hook length check" matches the main change. The PR widens the reported-length tolerance in the move-mode hook test to cover audio padding in each part's conta…
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.
Full details: Title check

Explanation

The title "Allow for audio padding in the hook length check" matches the main change. The PR widens the reported-length tolerance in the move-mode hook test to cover audio padding in each part's container duration. The title is specific and concise, and it names the aspect the author fixed.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1fb49e0c-a02d-4d4b-854a-a9c867c801f8
Commits

Reviewing files that changed from the base of the PR and between 1fff263 and b7fb3ea.

Files selected for processing: 1

  • tests/test_opening_hook.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Captions follow each part's probed length, so the audio padding allowed for
in the total length also builds up across the two joins. On the Windows
runner the last word landed at 5.285s against 5.2s, past the 0.05s
tolerance. The three-part test now allows 0.15s; the words are a second
apart, so it still checks which source second each one comes from.
@nmbrthirteen
nmbrthirteen merged commit db8fea1 into main Nov 23, 2026
16 checks passed
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