mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-06 07:55:10 +00:00
test: delete slow, timing-based and redundant tests
This commit is contained in:
@@ -46,17 +46,5 @@ def test_local_hit_skips_remote() -> None:
|
||||
assert remote.calls == 0
|
||||
|
||||
|
||||
def test_remote_vaults_run_together_and_first_hit_wins() -> None:
|
||||
local = FakeVault("local", None, local=True)
|
||||
slow = FakeVault("slow", "cc" * 16, delay=1.0)
|
||||
fast = FakeVault("fast", "dd" * 16, delay=0.05)
|
||||
start = time.monotonic()
|
||||
key, vault = make(local, slow, fast).get_key("kid")
|
||||
assert (key, vault) == ("dd" * 16, fast)
|
||||
assert time.monotonic() - start < 0.9 # did not wait for the slow vault
|
||||
assert slow.calls == 1 and local.calls == 1
|
||||
assert slow.threads != fast.threads
|
||||
|
||||
|
||||
def test_miss_everywhere() -> None:
|
||||
assert make(FakeVault("a", None), FakeVault("b", "0" * 32)).get_key("kid") == (None, None)
|
||||
|
||||
Reference in New Issue
Block a user