diff --git a/tests/async/test_admin.py b/tests/async/test_admin.py index 62806cb..68cba92 100644 --- a/tests/async/test_admin.py +++ b/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 diff --git a/tests/common/test_admin.py b/tests/common/test_admin.py index a384789..4e9c24a 100644 --- a/tests/common/test_admin.py +++ b/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