@@ -1575,10 +1575,6 @@ def test_replication_config(
15751575
15761576
15771577def test_replication_config_without_async_config (collection_factory : CollectionFactory ) -> None :
1578- collection_dummy = collection_factory ("dummy" )
1579- if collection_dummy ._connection ._weaviate_version .is_lower_than (1 , 26 , 0 ):
1580- pytest .skip ("async replication requires Weaviate >= 1.26.0" )
1581-
15821578 collection = collection_factory (
15831579 replication_config = Configure .replication (factor = 1 , async_enabled = False ),
15841580 )
@@ -1589,10 +1585,6 @@ def test_replication_config_without_async_config(collection_factory: CollectionF
15891585
15901586
15911587def test_replication_config_with_async_config (collection_factory : CollectionFactory ) -> None :
1592- collection_dummy = collection_factory ("dummy" )
1593- if collection_dummy ._connection ._weaviate_version .is_lower_than (1 , 36 , 0 ):
1594- pytest .skip ("async replication config requires Weaviate >= 1.36.0" )
1595-
15961588 collection = collection_factory (
15971589 replication_config = Configure .replication (
15981590 factor = 1 ,
@@ -1612,10 +1604,12 @@ def test_replication_config_with_async_config(collection_factory: CollectionFact
16121604 assert ac .hashtree_height == 20
16131605
16141606
1615- def test_replication_config_remove_async_config (collection_factory : CollectionFactory ) -> None :
1607+ def test_replication_config_remove_async_config_by_disabling_async_replication (
1608+ collection_factory : CollectionFactory ,
1609+ ) -> None :
16161610 collection_dummy = collection_factory ("dummy" )
1617- if collection_dummy ._connection ._weaviate_version .is_lower_than (1 , 36 , 0 ):
1618- pytest .skip ("async replication config requires Weaviate >= 1.36.0 " )
1611+ if collection_dummy ._connection ._weaviate_version .is_lower_than (1 , 34 , 18 ):
1612+ pytest .skip ("async replication config requires Weaviate >= 1.34.18 " )
16191613
16201614 collection = collection_factory (
16211615 replication_config = Configure .replication (
@@ -1641,6 +1635,109 @@ def test_replication_config_remove_async_config(collection_factory: CollectionFa
16411635 assert config .replication_config .async_config is None
16421636
16431637
1638+ def test_replication_config_remove_async_config (collection_factory : CollectionFactory ) -> None :
1639+ collection_dummy = collection_factory ("dummy" )
1640+ if collection_dummy ._connection ._weaviate_version .is_lower_than (1 , 34 , 18 ):
1641+ pytest .skip ("async replication config requires Weaviate >= 1.34.18" )
1642+
1643+ collection = collection_factory (
1644+ replication_config = Configure .replication (
1645+ factor = 1 ,
1646+ async_enabled = True ,
1647+ async_config = Configure .Replication .async_config (
1648+ max_workers = 8 ,
1649+ hashtree_height = 20 ,
1650+ ),
1651+ ),
1652+ )
1653+ config = collection .config .get ()
1654+ assert config .replication_config .async_config is not None
1655+ assert config .replication_config .async_config .max_workers == 8
1656+
1657+ collection .config .update (
1658+ replication_config = Reconfigure .replication (
1659+ factor = 1 , async_enabled = True , async_config = Reconfigure .Replication .async_config ()
1660+ ),
1661+ )
1662+ config = collection .config .get ()
1663+ assert config .replication_config .async_enabled is True
1664+ assert config .replication_config .async_config is None
1665+ assert config .replication_config .factor == 1
1666+
1667+
1668+ def test_replication_config_unset_single_async_field (
1669+ collection_factory : CollectionFactory ,
1670+ ) -> None :
1671+ collection_dummy = collection_factory ("dummy" )
1672+ if collection_dummy ._connection ._weaviate_version .is_lower_than (1 , 36 , 0 ):
1673+ pytest .skip ("async replication config requires Weaviate >= 1.36.0" )
1674+
1675+ collection = collection_factory (
1676+ replication_config = Configure .replication (
1677+ factor = 1 ,
1678+ async_enabled = True ,
1679+ async_config = Configure .Replication .async_config (
1680+ max_workers = 8 ,
1681+ hashtree_height = 20 ,
1682+ ),
1683+ ),
1684+ )
1685+ config = collection .config .get ()
1686+ ac = config .replication_config .async_config
1687+ assert ac is not None
1688+ assert ac .max_workers == 8
1689+ assert ac .hashtree_height == 20
1690+
1691+ # Update with only max_workers — hashtree_height reverts to server default
1692+ collection .config .update (
1693+ replication_config = Reconfigure .replication (
1694+ async_config = Reconfigure .Replication .async_config (
1695+ max_workers = 8 ,
1696+ ),
1697+ ),
1698+ )
1699+ config = collection .config .get ()
1700+ ac = config .replication_config .async_config
1701+ assert ac is not None
1702+ assert ac .max_workers == 8
1703+ assert ac .hashtree_height != 20
1704+
1705+
1706+ def test_replication_config_add_async_config_to_existing_collection (
1707+ collection_factory : CollectionFactory ,
1708+ ) -> None :
1709+ """Test updating a collection that was created without async_config to add one.
1710+
1711+ This covers the case where the existing schema has no asyncConfig key
1712+ and merge_with_existing must handle the missing field gracefully.
1713+ """
1714+ collection_dummy = collection_factory ("dummy" )
1715+ if collection_dummy ._connection ._weaviate_version .is_lower_than (1 , 34 , 18 ):
1716+ pytest .skip ("async replication config requires Weaviate >= 1.34.18" )
1717+
1718+ # Create without async_config
1719+ collection = collection_factory (
1720+ replication_config = Configure .replication (factor = 1 , async_enabled = True ),
1721+ )
1722+ config = collection .config .get ()
1723+ assert config .replication_config .async_config is None
1724+
1725+ # Update to add async_config
1726+ collection .config .update (
1727+ replication_config = Reconfigure .replication (
1728+ async_config = Reconfigure .Replication .async_config (
1729+ max_workers = 12 ,
1730+ propagation_concurrency = 4 ,
1731+ ),
1732+ ),
1733+ )
1734+ config = collection .config .get ()
1735+ assert config .replication_config .async_config is not None
1736+ ac = config .replication_config .async_config
1737+ assert ac .max_workers == 12
1738+ assert ac .propagation_concurrency == 4
1739+
1740+
16441741def test_update_property_descriptions (collection_factory : CollectionFactory ) -> None :
16451742 collection = collection_factory (
16461743 vectorizer_config = Configure .Vectorizer .none (),
0 commit comments