From 7f3272f3baad96611d437adacd30726701e9be25 Mon Sep 17 00:00:00 2001 From: Antti Kettunen Date: Tue, 28 Apr 2026 21:27:01 +0300 Subject: [PATCH] Trim slow retry from post-processing test Keep the fuzzy-context post-processing test on the fast path by stubbing the retry sleep, matching the other retry-path coverage and avoiding a ~20s pause in the downloads test suite. --- tests/downloads/test_downloads_post_processing.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/downloads/test_downloads_post_processing.py b/tests/downloads/test_downloads_post_processing.py index e3b03406..2076ef6e 100644 --- a/tests/downloads/test_downloads_post_processing.py +++ b/tests/downloads/test_downloads_post_processing.py @@ -323,7 +323,7 @@ def test_youtube_task_uses_get_download_status_to_resolve_path(monkeypatch): assert any(c[0] == 'mark_completed' for c in rec.calls) -def test_fuzzy_context_matching_when_exact_key_missing(): +def test_fuzzy_context_matching_when_exact_key_missing(monkeypatch): """When exact key isn't in matched_downloads_context, worker tries fuzzy match constrained to same Soulseek username.""" download_tasks['t1'] = { @@ -339,6 +339,7 @@ def test_fuzzy_context_matching_when_exact_key_missing(): deps, rec = _build_deps( find_completed_file=lambda *a, **kw: (None, None), # file not found ) + monkeypatch.setattr(pp.time, 'sleep', lambda s: None) # Won't find file → marks failed. But the fuzzy match log path executes. pp.run_post_processing_worker('t1', 'b1', deps) assert download_tasks['t1']['status'] == 'failed'