Skip to content

Commit 98f91e2

Browse files
reduce admin test timeouts
1 parent e59acf1 commit 98f91e2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

tests/async/test_admin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def with_instrumented_server(auth=False, **ikwargs):
2121
def decorator(f):
2222
@wraps(f)
2323
def wrapped(self, *args, **kwargs):
24-
sio = socketio.AsyncServer(async_mode='asgi')
24+
sio = socketio.AsyncServer(async_mode='asgi', ping_interval=10,
25+
ping_timeout=10)
2526

2627
@sio.event
2728
async def enter_room(sid, data):
@@ -37,6 +38,7 @@ def connect(sid, environ, auth):
3738

3839
async def shutdown():
3940
await self.isvr.shutdown()
41+
self.isvr.uninstrument()
4042
await sio.shutdown()
4143

4244
if 'server_stats_interval' not in ikwargs:
@@ -57,7 +59,6 @@ async def shutdown():
5759
ret = f(self, *args, **kwargs)
5860
finally:
5961
server.stop()
60-
self.isvr.uninstrument()
6162
self.isvr = None
6263

6364
EngineIOSocket.schedule_ping = original_schedule_ping

tests/common/test_admin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def with_instrumented_server(auth=False, **ikwargs):
1818
def decorator(f):
1919
@wraps(f)
2020
def wrapped(self, *args, **kwargs):
21-
sio = socketio.Server(async_mode='threading')
21+
sio = socketio.Server(async_mode='threading', ping_interval=10,
22+
ping_timeout=10)
2223

2324
@sio.event
2425
def enter_room(sid, data):
@@ -52,6 +53,7 @@ def connect(sid, environ, auth):
5253
server.stop()
5354
self.isvr.shutdown()
5455
self.isvr.uninstrument()
56+
sio.shutdown()
5557
self.isvr = None
5658

5759
EngineIOSocket.schedule_ping = original_schedule_ping

0 commit comments

Comments
 (0)