You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Test] RAG claim 행 잠금 통합 시험이 다른 Context의 RAG Worker와 경합하는 문제 #520
PR #519 CI(run 38869352820)에서 RagResponseClaimIntegrationTest.findNextUnclaimedProcessingForUpdate_skipsLockedRow만 실패했습니다(1,501건 중 1건). 138행 rowLocked.await(10s)가 false였고, 시험 시간은 10.062초였습니다. #519는 RAG 코드를 바꾸지 않았고, 같은 시험이 develop push CI(8971989)에서는 통과했습니다.
원인은 Spring 테스트 Context 캐시에 남아 있는 다른 시험 클래스 Context의 RagJobWorker 입니다. 이 Worker가 1초마다 같은 test 스키마를 polling합니다. 이 클래스는 @MockitoBean RagJobWorker로 자기 Context의 Worker만 막습니다(#515, dbeefd4). 시험이 만든 PROCESSING 작업을 외부 Worker가 먼저 claim하면 첫 트랜잭션이 잠글 행이 없습니다. 그러면 orElseThrow로 끝나 latch가 내려가지 않습니다.
07:49:55.512Z Started RagResponseClaimIntegrationTest (process running for 129.677)
07:49:55.563Z [rag-worker-job-1] Ollama 서버 호출 실패 ← 서로 다른 Context의 같은 이름 스레드 2개
07:49:55.571Z [rag-worker-job-1] [RAG] fallback queryId=6 errorCode=RAG-001
07:49:55.571Z [rag-worker-job-1] [RAG] fallback queryId=5 errorCode=RAG-001
로컬 격리 DB(pgvector 0.8.1-pg17)에서 재현했습니다. 작업 생성과 잠금 사이를 polling 주기보다 길게(1.5초) 벌렸습니다. 그 상태로 RagJobWorkerIntegrationTest 뒤에 실행하면 같은 단언에서 실패하고, 외부 rag-worker-job-1/2가 이 시험의 queryId를 처리합니다. 이 클래스만 단독으로 실행하면 통과합니다.
같은 클래스의 claim_allowsExactlyOneConcurrentOwner도 같은 경합에 노출되어 있습니다.
Activity
kangcheolung commentedon Oct 16, 2026
Branch test/520 created!
[Test] RAG claim 통합 시험을 전용 스키마로 격리
[Docs] RAG claim 시험 격리 재현·검증 기록