diff --git a/tests/test_rag_phase4_final_verify.py b/tests/test_rag_phase4_final_verify.py index 7121658f..aff79334 100644 --- a/tests/test_rag_phase4_final_verify.py +++ b/tests/test_rag_phase4_final_verify.py @@ -69,8 +69,18 @@ def test_phase4_final_verify(live_gui, live_gui_workspace): try: # 2. Configure project through Hook API + # set_value is async (push_event -> pending_gui_tasks -> render loop). + # Wait for the files setter to be processed before triggering the RAG + # sync, otherwise the sync sees self.files == [] and skips the rebuild + # (RAG sync only triggers the rebuild if both is_empty() AND self.files + # are truthy). The test was passing in 4d2a6666 because of timing; + # the project switch added latency, so the race is now exposed. client.set_value('rag_collection_name', _collection_name) client.set_value('files', ['final_test_1.txt', 'final_test_2.py']) + for _ in range(50): + if client.get_value('files') == ['final_test_1.txt', 'final_test_2.py']: + break + time.sleep(0.1) client.set_value('rag_enabled', True) client.set_value('rag_source', 'chroma') client.set_value('rag_emb_provider', 'local')