Add network transfer regression test for #942 - #945
Open
julienmoumne wants to merge 1 commit into
Open
Conversation
julienmoumne
force-pushed
the
942-abort-network-transfer-test
branch
from
August 19, 2026 19:14
d700d37 to
817c1cd
Compare
julienmoumne
marked this pull request as ready for review
August 19, 2026 19:27
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.
This is the first part of addressing #942.
It adds automated simulation coverage for the network traffic that continues after XetFileDownloadGroup::abort(), with sigint_abort() as a positive control.
It leverages the existing simulation infrastructure, adding a total_download_transferred counter to observe bytes actually forwarded to the client.
The failing regression is ignored for now so CI stays green.
Use this to run it :
cargo +1.94.1 test -p hf-xet --lib --features simulation test_group_abort_stops_network_transfer -- --include-ignored --nocaptureThe next step is to fix the cancellation propagation and enable the regression test.
Note
Low Risk
Changes are confined to simulation proxy metrics and gated integration tests; no production download or abort logic is modified yet.
Overview
Adds observable download bytes in the network simulation stack so tests can tell whether traffic keeps flowing after cancellation, as part of work on #942.
The bandwidth-limit proxy now tracks bytes actually forwarded upstream→client (not just theoretical refill capacity), plumbed through
LocalTestServer::total_download_bytes_transferred(). Copy helpers take an optional counter updated on each written chunk.New simulation tests in
file_download_groupstart a throttled multi-range download, cancel mid-transfer, then assert the proxy byte counter stays flat.test_group_abort_stops_network_transferis#[ignore]as the known failing regression;test_sigint_abort_stops_network_transferruns as a positive control.Reviewed by Cursor Bugbot for commit 817c1cd. Bugbot is set up for automated code reviews on this repo. Configure here.