mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-22 00:45:10 +00:00
fix: drop null vault keys, cap snapshot restore size, isolate test globals
Vaults.add_keys and kv add skip null content keys instead of failing the batch; is_null_key moves to core.vault. A manifest snapshot restore has one 32 MiB inflate budget. Tests reset the speed limiter and config between runs.
This commit is contained in:
@@ -15,16 +15,6 @@ requests_downloader = importlib.import_module("unshackle.core.downloaders.reques
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def clean_limiter():
|
||||
"""Start and end each test with no limiter, whatever an earlier test leaked."""
|
||||
requests_downloader.speed_limit_locked = False
|
||||
requests_downloader.speed_limiter = None
|
||||
yield
|
||||
requests_downloader.speed_limit_locked = False
|
||||
requests_downloader.speed_limiter = None
|
||||
|
||||
|
||||
@pytest.mark.parametrize(("lock", "expected"), [(True, 2_000_000.0), (False, None)])
|
||||
def test_worker_share_of_limit(lock, expected):
|
||||
requests_downloader.set_speed_limit(8_000_000, lock=lock)
|
||||
|
||||
Reference in New Issue
Block a user