Repository navigation
fix(cli): cloud upload tests stop flaking and two cuts at the same age count as one - #7352
Conversation
…keep complexity down
…till reports its bytes
There was a problem hiding this comment.
Verdict: APPROVE · 0 blocker · 0 important · 1 nit · head d8d8c4db
The Windows red on #7356 (run 42355071130, engine-cli-1) was stops after a second identical cut instead of repeating the doomed try. On this head, Windows render verification and CI pass. The fails without the fix: line names that test.
- nit: with the byte check gone, two unrelated drops whose ages land within 20% of each other (say 10 s and 11.5 s on flaky Wi-Fi) now stop after 2 tries, with the message "this link cannot finish it". That trade looks intended (a fixed-age cut is the case it targets). Just noting that
retries: 3no longer protects that case.
Scope
Read the full diff (upload.ts, upload.test.ts). The default sample period is unchanged in production (min(1000, stallMs/3) either way). The tests still run on wall time against a real server. The PR doesn't claim a fake clock; it uses a fixed drain rate and a 5 s stall limit for the big file.
|
Thanks. The nit is a deliberate trade: two cuts that land at about the same age (within 20%) are treated as one fixed-age cut, because that is the pattern in the reports and each further try costs minutes on a link that cannot finish. The cost is what you describe: two unrelated drops at similar ages now stop after 2 tries instead of 4. A follow-up that sends the file in pieces retries each piece alone, so a drop then costs one piece and this stop rule matters much less. |
…-com#7336-heygen-com#7358 Adopt heygen-com#7304 (without CLI renderDiagnostic, needs heygen-com#6725), heygen-com#7331, heygen-com#7332, heygen-com#7334, heygen-com#7337, heygen-com#7336, heygen-com#7339, heygen-com#7289, heygen-com#5594, heygen-com#6900, heygen-com#7322, heygen-com#7342, heygen-com#7343, heygen-com#7350 (onProgress only), heygen-com#7352, heygen-com#7348, heygen-com#7344, heygen-com#7353, heygen-com#7356 and heygen-com#7355. Defer heygen-com#5708 (needs heygen-com#6911) and heygen-com#7345 (READ_VERSION 4 vs 7); heygen-com#7307 not applicable. Re-read 14 moved pins, pin 6 new PRs (monitored 126). Make checkReportFile module-private and suppress the cross-package closeTestChrome duplicate for fallow. Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com> Co-authored-by: SophiaHuangCc <129631224+SophiaHuangCc@users.noreply.github.com> Co-authored-by: Dante <duanjl.china@gmail.com> Co-authored-by: Muzzy5150 <muzzy5150yt@gmail.com> Co-authored-by: ump45nose <52391318+ump45nose@users.noreply.github.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
Follow-up to the cloud upload change that already merged: its progress and slow-server tests flaked, its retry loop was over the complexity limit, and the "same cut twice" rule compared bytes that vary from run to run.
repeatedCut; the test server's body reading intodrain, sofallow auditno longer flagsputWithRetryand the test server.putTimings.sampleMs, 1 s by default) and no longer on the stall interval, so a try that dies in under a second still reports the bytes it sent.Why
upload.test.tsfailed 1 run in 5 on the progress test and about 1 in 2 on the identical-cut test under load. Root causes: the stall watcher also drove the progress sampling (so a short try reported 0 bytes), the cut test compared byte counts across tries (kernel buffering varies), and the test server's drain rate depended on the chunk size the kernel handed it.Size
A follow-up in the same module and its test, tied to one root (the flaky timing in the upload tests); nothing else touches them.
Test plan
cd packages/cli && npx vitest run src/cloud/upload.test.ts: 20 passed, 6 runs in a row, on a clean checkout; oxlint and oxfmt clean on both files.upload.ts(it keeps retrying four times when the bytes differ between tries).fallow audit --base origin/mainreports no new finding in the two files.Size: a lone flake fix. It turns other PRs Windows-red and no open PR in the upload tests can carry it.