From bb77de75515cbdfc3d8928adcfe23f81360e9dc4 Mon Sep 17 00:00:00 2001 From: Vladislav Date: Sun, 24 Sep 2023 15:42:31 +0300 Subject: [PATCH] fix(regests): Fix port detection with gdb (#1922) Signed-off-by: Vladislav Oleshko --- tests/dragonfly/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/dragonfly/__init__.py b/tests/dragonfly/__init__.py index 210f385de..15fdf6a98 100644 --- a/tests/dragonfly/__init__.py +++ b/tests/dragonfly/__init__.py @@ -12,7 +12,7 @@ from redis.asyncio import Redis as RedisClient from dataclasses import dataclass START_DELAY = 0.8 -START_GDB_DELAY = 3.0 +START_GDB_DELAY = 5.0 @dataclass @@ -163,6 +163,12 @@ class DflyInstance: if self.proc is None: raise RuntimeError("port is not available yet") p = psutil.Process(self.proc.pid) + + # If running with gdb, look for port on child + children = p.children() + if len(children) == 1 and children[0].name() == "dragonfly": + p = children[0] + ports = set() for connection in p.connections(): if connection.status == "LISTEN":