fix: harden task3 qdrant compatibility boundaries
This commit is contained in:
@@ -460,7 +460,7 @@ def test_registry_rendered_session_and_maintenance_configs_require_existing_qdra
|
||||
assert yaml.safe_load(maintenance_path.read_text())["vectors"]["collection_lifecycle"] == "require_existing"
|
||||
assert session_path.read_bytes() == maintenance_path.read_bytes()
|
||||
|
||||
from test_qdrant_vector_store import FakeQdrantHttp, _write_record
|
||||
from qdrant_test_helpers import FakeQdrantHttp, _write_record
|
||||
|
||||
for cfg in (session_cfg, maintenance_cfg):
|
||||
fake = FakeQdrantHttp(dimension=384) if collection_state == "incompatible" else FakeQdrantHttp()
|
||||
@@ -481,6 +481,40 @@ def test_registry_rendered_session_and_maintenance_configs_bind_equally(tmp_path
|
||||
)
|
||||
|
||||
|
||||
def test_loader_rejects_split_brain_qdrant_compatibility_resources(tmp_path):
|
||||
values = _qdrant_config_yaml(tmp_path, registry=True)
|
||||
values["vectors"]["collection"] = "workspace-a"
|
||||
values["resources"] = {
|
||||
"vector": {
|
||||
"engine": "qdrant",
|
||||
"base_url": "http://qdrant:6333/",
|
||||
"collection": "workspace-b",
|
||||
}
|
||||
}
|
||||
path = tmp_path / "split-brain.yaml"
|
||||
path.write_text(yaml.safe_dump(values))
|
||||
|
||||
with pytest.raises(ConfigError, match="vectors.*resources.vector|disagree"):
|
||||
load_config(path)
|
||||
|
||||
|
||||
def test_loader_rejects_lifecycle_policy_in_compatibility_resource(tmp_path):
|
||||
values = _qdrant_config_yaml(tmp_path, registry=True)
|
||||
values["resources"] = {
|
||||
"vector": {
|
||||
"engine": "qdrant",
|
||||
"base_url": "http://qdrant:6333",
|
||||
"collection": "workspace-semantic",
|
||||
"collection_lifecycle": "require_existing",
|
||||
}
|
||||
}
|
||||
path = tmp_path / "lifecycle.yaml"
|
||||
path.write_text(yaml.safe_dump(values))
|
||||
|
||||
with pytest.raises(ConfigError, match="collection_lifecycle"):
|
||||
load_config(path)
|
||||
|
||||
|
||||
def test_legacy_runtime_config_keeps_create_capable_qdrant_default(tmp_path):
|
||||
path = tmp_path / "legacy.yaml"
|
||||
path.write_text(yaml.safe_dump(_qdrant_config_yaml(tmp_path, registry=False)))
|
||||
|
||||
Reference in New Issue
Block a user