Context
run_transfer_effect's pre-scan is time-boxed via tokio::select! { ... () = sleep(SCAN_BUDGET) => None }
(PR #166). The entry-cap path is unit-tested; the time-box branch itself is not — it needs a
slow backend and a full run_transfer_effect harness, so it was deferred.
Proposal
Extract the scan race into a small helper (e.g. scan_with_deadline(src, items, max_entries, budget, cancel, on_scan)) and unit-test it with #[tokio::test(start_paused = true)] + tokio::time::advance,
using a trivial Vfs whose stat/list sleep past the budget. Assert it returns None (and a fast
mock returns the real total). Optionally, an end-to-end test that an abandoned scan still lets the copy
proceed and emit TransferDone.
Context
run_transfer_effect's pre-scan is time-boxed viatokio::select! { ... () = sleep(SCAN_BUDGET) => None }(PR #166). The entry-cap path is unit-tested; the time-box branch itself is not — it needs a
slow backend and a full
run_transfer_effectharness, so it was deferred.Proposal
Extract the scan race into a small helper (e.g.
scan_with_deadline(src, items, max_entries, budget, cancel, on_scan)) and unit-test it with#[tokio::test(start_paused = true)]+tokio::time::advance,using a trivial
Vfswhosestat/listsleep past the budget. Assert it returnsNone(and a fastmock returns the real total). Optionally, an end-to-end test that an abandoned scan still lets the copy
proceed and emit
TransferDone.