Repository navigation
Test the Lossless Timestamp Repair Through a Successful Repair - #1155
Conversation
Drive RepairTimestamps() through the setts tier with fake tools. The test fails when the language restore is dropped, runs after the move, or the move itself is dropped. A failed edit leaves the original intact. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sample tool data already installs an MkvMerge fake that covers the lossless repair test, and the packet JSON writer moves into FakeTools. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 4 minutes. View limit details
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. |
PR Summary by QodoTest successful lossless timestamp repair and language restoration
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
1.
|
There was a problem hiding this comment.
🟢 Approval recommended
The review found no active issues, with targeted success and failure coverage for lossless timestamp repair—including restoration, replacement, state updates, cleanup, and original-file preservation—plus reusable packet-fixture generation.
No open issues 🎉
What changed in this PR
Adds fake-tool coverage for the successful lossless timestamp-repair path, verifying language restoration before replacing the original file and preserving the original when restoration fails. It also consolidates packet-fixture generation for reuse across tests.
Changes:
- Adds success and failure cases for
RepairTimestamps()through the lossless repair tier. - Verifies temporary-file handling, state updates, original-file preservation, and cleanup.
- Extracts packet JSON generation into
FakeTools.WritePackets().
| File | Description |
|---|---|
PlexCleanerTests/ReplaceOriginalTests.cs |
Adds lossless timestamp-repair replacement and language-restore coverage. |
PlexCleanerTests/ReEncodeBitrateStateTests.cs |
Reuses the shared packet fixture helper. |
PlexCleanerTests/FakeTools.cs |
Adds the shared JSON packet fixture writer. |
This pull request is ready to be approved.
Review effort: Lite
The shared MkvMerge fake writes every temp argument, so the test passed with the setts rewrite skipped. The remux fake now requires name.tmp14. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
|
Qodo finding 1, "A skipped rewrite passes the repair test": fixed in 960c0e9, with the why comment in c7b6c99. The test now has its own MkvMerge fake that exits 2 unless its name.tmp14 input exists, and writes only the tmp4 and tmp11 outputs. With the SetTimestamps call replaced by a no-op, both cases now fail. The setts invocation needs no separate assertion: name.tmp14 can only exist if the setts arm wrote it, so a passing run proves setts ran. |
Adds the test #1151 asks for. It drives
ProcessFile.RepairTimestamps()through the lossless setts tier to a successful repair, the one FFmpeg rewrite path that had no fake-tool test of its language restore.ReplaceOriginalTests.RepairTimestamps_LosslessRepair_ReplacesOriginalOnlyAfterLanguageRestoreruns with MkvPropEdit exiting 0 and 2.name.tmp14, writesname.tmp14for the setts command, and returns the samestreamhashlines for every file. The re-encode exits 1, and so does HandBrake, so no later tier can replace the original.name.tmp14input exists. So a skipped setts rewrite fails the test rather than the remux creating the temp file.name.tmp14 mkvmerge. That shows the edit ran on the MkvMerge output, before the move removed the temp file.Verified | Repaired. When the edit fails, the original is byte-identical, the state isVerifyFailed | RepairFailed, and noname.tmp*file is left behind.FakeTools.WritePacketsnow holds the packet JSON writer thatReEncodeBitrateStateTests.CatPacketsused to build inline. Both tests use it, and the JSONCatPacketswrites is unchanged.The test carries comment lines that say why the fakes are built as they are, so this PR carries the
commentslabel.Verification: the full .NET suite passes (485 tests), and CSharpier and
dotnet format styleare clean. To check that the test bites, I changedTryLosslessTimestampRepair()four ways. Skipping theSetTimestampscall failed both cases. Dropping theRestoreLanguageTagscall failed both cases. Moving it after theFile.Movefailed both cases. Dropping theFile.Movefailed the success case. Windows skips the test, as it does every other shell-script fake-tool test.Pre-existing findings, not filed
PlexCleaner/ProcessFile.csTimestampRepairRegressionGate(): test coverage. No test drives the gate's reject path (astreamhashmismatch, or a timing shift beyondSyncToleranceSeconds), so a gate stuck at pass goes unnoticed. This PR covers only the pass path, as Test the Lossless Timestamp Repair Through a Successful Repair #1151 asks.🤖 Generated with Claude Code