mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Try a few times before raising the error
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
b44f80163a
commit
686f1d2fa9
1 changed files with 15 additions and 5 deletions
|
@ -165,11 +165,21 @@ def test_pub_server_channel(
|
|||
|
||||
req_server_channel.post_fork(handle_payload, io_loop=io_loop)
|
||||
if master_config["transport"] == "zeromq":
|
||||
p = Path(str(master_config["sock_dir"])) / "workers.ipc"
|
||||
mode = os.lstat(p).st_mode
|
||||
assert bool(os.lstat(p).st_mode & stat.S_IRUSR)
|
||||
assert not bool(os.lstat(p).st_mode & stat.S_IRGRP)
|
||||
assert not bool(os.lstat(p).st_mode & stat.S_IROTH)
|
||||
time.sleep(1)
|
||||
attempts = 5
|
||||
while True:
|
||||
try:
|
||||
p = Path(str(master_config["sock_dir"])) / "workers.ipc"
|
||||
mode = os.lstat(p).st_mode
|
||||
assert bool(os.lstat(p).st_mode & stat.S_IRUSR)
|
||||
assert not bool(os.lstat(p).st_mode & stat.S_IRGRP)
|
||||
assert not bool(os.lstat(p).st_mode & stat.S_IROTH)
|
||||
break
|
||||
except FileNotFoundError as exc:
|
||||
if not attempts:
|
||||
raise exc from None
|
||||
attempts -= 1
|
||||
time.sleep(2.5)
|
||||
|
||||
pub_channel = salt.channel.client.AsyncPubChannel.factory(minion_config)
|
||||
received = []
|
||||
|
|
Loading…
Add table
Reference in a new issue