From 67aea782431ce30438d5f8b03a28c433bf439f3b Mon Sep 17 00:00:00 2001 From: Igor Loskutov Date: Wed, 11 Feb 2026 16:26:24 -0500 Subject: [PATCH] fix: mock Celery broker in idle transcript validation test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test_validation_idle_transcript_with_recording_allowed called validate_transcript_for_processing without mocking task_is_scheduled_or_active, which attempts a real Celery broker connection (AMQP port 5672). Other tests in the same file already mock this — apply the same pattern here. --- server/tests/test_hatchet_dispatch.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/tests/test_hatchet_dispatch.py b/server/tests/test_hatchet_dispatch.py index 390b8e81..fb3f0b0c 100644 --- a/server/tests/test_hatchet_dispatch.py +++ b/server/tests/test_hatchet_dispatch.py @@ -291,7 +291,12 @@ async def test_validation_idle_transcript_with_recording_allowed(): recording_id="test-recording-id", ) - result = await validate_transcript_for_processing(mock_transcript) + with patch( + "reflector.services.transcript_process.task_is_scheduled_or_active" + ) as mock_celery_check: + mock_celery_check.return_value = False + + result = await validate_transcript_for_processing(mock_transcript) assert isinstance(result, ValidationOk) assert result.recording_id == "test-recording-id"