From dec0712e15ae7628d3d6d0b15da98c9c0c21985a Mon Sep 17 00:00:00 2001 From: Borys Date: Tue, 22 Oct 2024 15:01:32 +0300 Subject: [PATCH] test: add test to test big collections or collections with big values (#3959) --- tests/dragonfly/replication_test.py | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/dragonfly/replication_test.py b/tests/dragonfly/replication_test.py index 3533e8f70..e9f71a4c0 100644 --- a/tests/dragonfly/replication_test.py +++ b/tests/dragonfly/replication_test.py @@ -2626,3 +2626,34 @@ async def test_replica_of_replica(df_factory): await c_replica2.execute_command(f"REPLICAOF localhost {replica.port}") assert await c_replica2.execute_command(f"REPLICAOF localhost {master.port}") == "OK" + + +@pytest.mark.asyncio +@pytest.mark.slow +async def test_big_containers(df_factory): + master = df_factory.create(proactor_threads=4) + replica = df_factory.create(proactor_threads=4) + + df_factory.start_all([master, replica]) + c_master = master.client() + c_replica = replica.client() + + logging.debug("Fill master with test data") + seeder = StaticSeeder( + key_target=20, + data_size=4000000, + collection_size=1000, + variance=100, + samples=1, + types=["LIST", "SET", "ZSET", "HASH"], + ) + await seeder.run(c_master) + + logging.debug("Start replication and wait for full sync") + await c_replica.execute_command(f"REPLICAOF localhost {master.port}") + await wait_for_replicas_state(c_replica) + + # Check replica data consisten + replica_data = await StaticSeeder.capture(c_replica) + master_data = await StaticSeeder.capture(c_master) + assert master_data == replica_data