Skip to content

Commit 88e5adf

Browse files
reduce admin test timeouts
1 parent e59acf1 commit 88e5adf

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
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 & 2 deletions
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):
@@ -49,10 +50,10 @@ def connect(sid, environ, auth):
4950
try:
5051
ret = f(self, *args, **kwargs)
5152
finally:
52-
server.stop()
5353
self.isvr.shutdown()
5454
self.isvr.uninstrument()
5555
self.isvr = None
56+
server.stop()
5657

5758
EngineIOSocket.schedule_ping = original_schedule_ping
5859

0 commit comments

Comments
 (0)