Skip to content

Commit 281f027

Browse files
committed
test/infamy: wait for transport reachability after test_reset()
test_reset() triggers a config reload which causes services such as rousette to restart. Wait for the transport to become reachable again before returning from attach(), preventing subsequent API calls from racing with a still-restarting backend. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1 parent 4dee5e4 commit 281f027

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

test/infamy/env.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ def attach(self, node, port="mgmt", protocol=None, test_reset=True, username=Non
166166
yangdir=self.args.yangdir)
167167
if test_reset:
168168
dev.test_reset()
169+
util.until(lambda: self.is_reachable(node, cport), 30)
169170
return dev
170171

171172
if protocol == "ssh":
@@ -181,6 +182,7 @@ def attach(self, node, port="mgmt", protocol=None, test_reset=True, username=Non
181182
yangdir=self.args.yangdir)
182183
if test_reset:
183184
dev.test_reset()
185+
util.until(lambda: self.is_reachable(node, cport), 30)
184186
return dev
185187

186188
raise Exception(f"Unsupported management procotol \"{protocol}\"")

0 commit comments

Comments
 (0)