Skip to content

Commit cf15efe

Browse files
committed
tenants: Add test to validate shard creation
Add test case to ensure a shard is created after the tenant creation Signed-off-by: Rodrigo Lopez <[email protected]>
1 parent cb03b68 commit cf15efe

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

integration/test_tenants.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@
2222
from weaviate.exceptions import WeaviateInvalidInputError, WeaviateUnsupportedFeatureError
2323

2424

25+
def test_shards_on_tenants(client_factory: ClientFactory, collection_factory: CollectionFactory):
26+
collection = collection_factory(
27+
vectorizer_config=Configure.Vectorizer.none(),
28+
multi_tenancy_config=Configure.multi_tenancy(enabled=True),
29+
)
30+
collection.tenants.create(Tenant(name="tenant1"))
31+
client = client_factory()
32+
count = sum(
33+
len(node.shards) for node in client.cluster.nodes(collection.name, output="verbose")
34+
)
35+
36+
assert count == 1
37+
38+
2539
@pytest.mark.parametrize("tenant", ["tenant1", Tenant(name="tenant1")])
2640
def test_delete_by_id_tenant(
2741
collection_factory: CollectionFactory, tenant: Union[str, Tenant]

0 commit comments

Comments
 (0)