Repository navigation
test: keep what's on its way at a cancel from failing the upload harnesses - #460
Merged
Merged
Conversation
…esses A publish cancelled with a request on its way failed the test around it, not the plugin. stop() read the fake host's record before the answering thread had finished, so that request landed on an empty one, and the YouTube host opened a video the cancelled plugin had already removed.
bnb
approved these changes
Nov 5, 2026
Rust coverageFrom run 380. Both are held to the thresholds in .cargo/config.toml.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a flake in
plugins/youtube'sprop_a_cancel_stops_the_publish_wherever_it_is, from #437, which failed unrelated PRs: #447 (Linux), #453 (Hegel coverage) and #454 (macOS). The plugin is right and the test harness was wrong.The host answers a chunk, then cancels. The plugin can read the answer and send the next chunk before the cancel reaches it, which the test expects (
n + 1..=n + 2requests). That chunk then races the test's teardown in two ways:Session::stopread the fake host's record, then closed the connection and joined the answering thread. A chunk arriving after that read found an empty record, soa chunk goes on from where YouTube got tofailed with left 65536, right 0, on the answering thread. The test thread then failed atanswering.join(), and atreceived()on the poisoned mutex.cancelled.Changed
stopin the archive, mixcloud, plyr, soundcloud and youtube harnesses reads the record after the answering thread has finished, so it holds everything the plugin sent. All five had this order. The doc comments on three said the record was complete because the plugin sends nothing once it has answered; that's true of the plugin, but not of what's already on its way. Their cancel tests already allow the one extra request, so no assertion changes.cancelledonce it has cancelled the publish, and still counts it.Added and removed
Nothing.
Both races were reproduced on demand by delaying the fake host between answering and cancelling, and before it handled a request: the first panicked at
youtube.rs:166, and with only that fixed the second panicked at:172. With both fixed, the test passed 15 of 15 under the same delays, and all five crates' tests passed 3 of 3. Without the delays the test passed 40 of 40 and all five crates' tests 5 of 5.