fix(tests): use current python for rag id stability (#1817)
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import os
|
||||
import subprocess
|
||||
import pytest
|
||||
import sys
|
||||
|
||||
def test_rag_id_stability_across_processes():
|
||||
# Run helper in subprocesses with different PYTHONHASHSEED values to ensure cross-process stability
|
||||
cmd = ["./venv/bin/python", "-c", "from src.rag_vector import _generate_doc_id; print(_generate_doc_id('test_text_hash'))"]
|
||||
cmd = [sys.executable, "-c", "from src.rag_vector import _generate_doc_id; print(_generate_doc_id('test_text_hash'))"]
|
||||
|
||||
env0 = os.environ.copy()
|
||||
env0["PYTHONHASHSEED"] = "0"
|
||||
@@ -23,6 +23,6 @@ def test_rag_id_stability_across_processes():
|
||||
assert id0 == id_rand
|
||||
|
||||
# Assert different inputs produce different IDs
|
||||
cmd_diff = ["./venv/bin/python", "-c", "from src.rag_vector import _generate_doc_id; print(_generate_doc_id('different_text_hash'))"]
|
||||
cmd_diff = [sys.executable, "-c", "from src.rag_vector import _generate_doc_id; print(_generate_doc_id('different_text_hash'))"]
|
||||
id_diff = subprocess.check_output(cmd_diff, env=env0).decode().strip()
|
||||
assert id0 != id_diff
|
||||
|
||||
Reference in New Issue
Block a user