fix: Manual polling typo
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 36s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 51s
Deploy to Staging / Verify Staging (pull_request) Successful in 8s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 7s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped

This commit is contained in:
Eric Gullickson
2026-02-11 20:06:03 -06:00
parent a078962d3f
commit 55a7bcc874
2 changed files with 6 additions and 3 deletions

View File

@@ -119,7 +119,11 @@ class ManualExtractor:
f"Extraction complete: {len(schedules)} schedules in {processing_time_ms}ms"
)
update_progress(100, "Complete")
# Note: do NOT send 100% progress here. The caller sets status=COMPLETED
# after this returns. Because this runs in a thread executor and the
# progress callback uses run_coroutine_threadsafe (fire-and-forget),
# a 100% update here races with complete_manual_job() and can overwrite
# COMPLETED back to PROCESSING.
return ManualExtractionResult(
success=True,

View File

@@ -108,12 +108,11 @@ class TestNormalExtraction:
extractor.extract(_make_pdf_bytes(), progress_callback=track_progress)
# Should have progress calls at 10, 50, 95, 100
# Should have progress calls at 10, 50, 95 (100% is set by complete_manual_job)
percents = [p for p, _ in progress_calls]
assert 10 in percents
assert 50 in percents
assert 95 in percents
assert 100 in percents
# Percents should be non-decreasing
assert percents == sorted(percents)