зеркало из https://github.com/microsoft/CCF.git
Allow for fd closing delay in connections test (#2687)
This commit is contained in:
Родитель
1d3a313440
Коммит
a521c8d798
|
@ -22,11 +22,15 @@ class AllConnectionsCreatedException(Exception):
|
|||
"""
|
||||
|
||||
|
||||
def get_session_metrics(node):
|
||||
def get_session_metrics(node, timeout=3):
|
||||
with node.client() as c:
|
||||
r = c.get("/node/metrics")
|
||||
assert r.status_code == http.HTTPStatus.OK, r.status_code
|
||||
return r.body.json()["sessions"]
|
||||
end_time = time.time() + timeout
|
||||
while time.time() < end_time:
|
||||
r = c.get("/node/metrics")
|
||||
if r.status_code == http.HTTPStatus.OK:
|
||||
return r.body.json()["sessions"]
|
||||
time.sleep(0.1)
|
||||
assert r.status_code == http.HTTPStatus.OK, r
|
||||
|
||||
|
||||
def run(args):
|
||||
|
|
Загрузка…
Ссылка в новой задаче