1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-14 11:58:02 +00:00

test: add test to test big collections or collections with big values (#3959)

This commit is contained in:
Borys 2024-10-22 15:01:32 +03:00 committed by GitHub
parent 119723316e
commit dec0712e15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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