Skip to content

Commit ce5c44b

Browse files
authored
feat test: add test for pipeline queue overlimit (#4791)
* feat test: add test for pipeline queue overlimit Signed-off-by: adi_holden <[email protected]>
1 parent 5bd7ea7 commit ce5c44b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/dragonfly/connection_test.py

+26
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,32 @@ async def push_pipeline(bad_actor_client, size=1):
11591159
assert info["dispatch_queue_bytes"] == 0
11601160

11611161

1162+
@dfly_args({"proactor_threads": 4, "pipeline_queue_limit": 10})
1163+
async def test_pipeline_overlimit(df_factory: DflyInstanceFactory):
1164+
server = df_factory.create()
1165+
server.start()
1166+
1167+
client = server.client()
1168+
1169+
await client.set("x", "a" * 1024 * 5)
1170+
1171+
async def pipe_overlimit():
1172+
c = server.client()
1173+
pipe = c.pipeline()
1174+
for i in range(1000):
1175+
pipe.get("x")
1176+
logging.debug("Executing...")
1177+
res = await pipe.execute()
1178+
logging.debug(f"Executed.")
1179+
1180+
pipeline_tasks = [asyncio.create_task(pipe_overlimit()) for _ in range(20)]
1181+
1182+
await asyncio.sleep(2)
1183+
await client.config_set("pipeline_queue_limit", 10000)
1184+
for task in pipeline_tasks:
1185+
await task
1186+
1187+
11621188
async def test_client_unpause(df_factory):
11631189
server = df_factory.create()
11641190
server.start()

0 commit comments

Comments
 (0)