mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix netapi tests
This commit is contained in:
parent
af2c268347
commit
de45a7bed0
3 changed files with 14 additions and 3 deletions
|
@ -752,7 +752,9 @@ class Master(SMaster):
|
|||
SMaster.secrets["aes"] = {
|
||||
"secret": multiprocessing.Array(
|
||||
ctypes.c_char,
|
||||
salt.utils.stringutils.to_bytes(salt.crypt.Crypticle.generate_key_string()),
|
||||
salt.utils.stringutils.to_bytes(
|
||||
salt.crypt.Crypticle.generate_key_string()
|
||||
),
|
||||
),
|
||||
"serial": multiprocessing.Value(
|
||||
ctypes.c_longlong, lock=False # We'll use the lock from 'secret'
|
||||
|
|
|
@ -435,7 +435,15 @@ class TCPPubClient(salt.transport.base.PublishClient):
|
|||
while True:
|
||||
msg = await self.recv()
|
||||
if msg:
|
||||
await callback(msg)
|
||||
try:
|
||||
# XXX This is handled better in the websocket transport work
|
||||
await callback(msg)
|
||||
except Exception:
|
||||
log.error(
|
||||
"Unhandled exception while running callback %r",
|
||||
self,
|
||||
exc_info=True,
|
||||
)
|
||||
|
||||
def on_recv(self, callback):
|
||||
"""
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from functools import partial
|
||||
|
||||
import asyncio
|
||||
import pytest
|
||||
import tornado.gen
|
||||
|
||||
|
@ -45,6 +46,6 @@ async def test_get(http_client, io_loop, app):
|
|||
)
|
||||
|
||||
while len(events_fired) < 5:
|
||||
await tornado.gen.sleep(1)
|
||||
await asyncio.sleep(1)
|
||||
|
||||
assert len(events_fired) >= 5
|
||||
|
|
Loading…
Add table
Reference in a new issue