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

fix(regests): Fix port detection with gdb (#1922)

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
This commit is contained in:
Vladislav 2023-09-24 15:42:31 +03:00 committed by GitHub
parent bbcfee1d1a
commit bb77de7551
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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