Skip to content

Add network transfer regression test for #942 - #945

Open
julienmoumne wants to merge 1 commit into
huggingface:mainfrom
julienmoumne:942-abort-network-transfer-test
Open

Add network transfer regression test for #942#945
julienmoumne wants to merge 1 commit into
huggingface:mainfrom
julienmoumne:942-abort-network-transfer-test

Conversation

@julienmoumne

@julienmoumne julienmoumne commented Aug 19, 2026

Copy link
Copy Markdown

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 --nocapture

The 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_group start a throttled multi-range download, cancel mid-transfer, then assert the proxy byte counter stays flat. test_group_abort_stops_network_transfer is #[ignore] as the known failing regression; test_sigint_abort_stops_network_transfer runs as a positive control.

Reviewed by Cursor Bugbot for commit 817c1cd. Bugbot is set up for automated code reviews on this repo. Configure here.

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