mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-09-12 21:57:19 -04:00
All the risk parallel downloads added lives in the dispatch loop, and none of it was reachable while the only way to run a book was to download one. Driven through ProcessBookHandler, every book here finishes when the test says so and never touches the network, the database or the disk. The loop is the real one. Covers the capacity cap, including lowering it mid-run while more books than the new cap are still in flight; the enqueue signal, both for books queued into free slots and for one arriving as the loop winds down; the abort drain, that it clears the queue and the loop still comes back rather than dying inside it; that only the book which answered Abort claims it while the rest report Cancelled; that a faulted book task is observed instead of taking the loop out through its outer catch; and Cancel All. The abort test runs one book at a time on purpose. With more, a book finishing in the same instant as the abort lets the loop take one more off the queue before the queue is cleared - the narrow window noted in the abort commit - and that is not what this test is about.