Browse Source

reduce admin test timeouts

pull/1498/head
Miguel Grinberg 3 weeks ago
parent
commit
88e5adf3bb
Failed to extract signature
  1. 5
      tests/async/test_admin.py
  2. 5
      tests/common/test_admin.py

5
tests/async/test_admin.py

@ -21,7 +21,8 @@ def with_instrumented_server(auth=False, **ikwargs):
def decorator(f):
@wraps(f)
def wrapped(self, *args, **kwargs):
sio = socketio.AsyncServer(async_mode='asgi')
sio = socketio.AsyncServer(async_mode='asgi', ping_interval=10,
ping_timeout=10)
@sio.event
async def enter_room(sid, data):
@ -37,6 +38,7 @@ def with_instrumented_server(auth=False, **ikwargs):
async def shutdown():
await self.isvr.shutdown()
self.isvr.uninstrument()
await sio.shutdown()
if 'server_stats_interval' not in ikwargs:
@ -57,7 +59,6 @@ def with_instrumented_server(auth=False, **ikwargs):
ret = f(self, *args, **kwargs)
finally:
server.stop()
self.isvr.uninstrument()
self.isvr = None
EngineIOSocket.schedule_ping = original_schedule_ping

5
tests/common/test_admin.py

@ -18,7 +18,8 @@ def with_instrumented_server(auth=False, **ikwargs):
def decorator(f):
@wraps(f)
def wrapped(self, *args, **kwargs):
sio = socketio.Server(async_mode='threading')
sio = socketio.Server(async_mode='threading', ping_interval=10,
ping_timeout=10)
@sio.event
def enter_room(sid, data):
@ -49,10 +50,10 @@ def with_instrumented_server(auth=False, **ikwargs):
try:
ret = f(self, *args, **kwargs)
finally:
server.stop()
self.isvr.shutdown()
self.isvr.uninstrument()
self.isvr = None
server.stop()
EngineIOSocket.schedule_ping = original_schedule_ping

Loading…
Cancel
Save