File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed
Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff 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 = 1 ,
25+ ping_timeout = 1 )
2526
2627 @sio .event
2728 async def enter_room (sid , data ):
@@ -201,10 +202,10 @@ def test_admin_connect_only_admin(self):
201202
202203 @with_instrumented_server ()
203204 def test_admin_connect_with_others (self ):
204- with socketio .SimpleClient () as client1 , \
205- socketio .SimpleClient () as client2 , \
206- socketio .SimpleClient () as client3 , \
207- socketio .SimpleClient () as admin_client :
205+ with socketio .SimpleClient (reconnection = False ) as client1 , \
206+ socketio .SimpleClient (reconnection = False ) as client2 , \
207+ socketio .SimpleClient (reconnection = False ) as client3 , \
208+ socketio .SimpleClient (reconnection = False ) as admin_client :
208209 client1 .connect ('http://localhost:8900' )
209210 client1 .emit ('enter_room' , 'room' )
210211 sid1 = client1 .sid
Original file line number Diff line number Diff 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 = 1 ,
22+ ping_timeout = 1 )
2223
2324 @sio .event
2425 def enter_room (sid , data ):
@@ -177,10 +178,10 @@ def test_admin_connect_only_admin(self):
177178
178179 @with_instrumented_server ()
179180 def test_admin_connect_with_others (self ):
180- with socketio .SimpleClient () as client1 , \
181- socketio .SimpleClient () as client2 , \
182- socketio .SimpleClient () as client3 , \
183- socketio .SimpleClient () as admin_client :
181+ with socketio .SimpleClient (reconnection = False ) as client1 , \
182+ socketio .SimpleClient (reconnection = False ) as client2 , \
183+ socketio .SimpleClient (reconnection = False ) as client3 , \
184+ socketio .SimpleClient (reconnection = False ) as admin_client :
184185 client1 .connect ('http://localhost:8900' )
185186 client1 .emit ('enter_room' , 'room' )
186187 sid1 = client1 .sid
You can’t perform that action at this time.
0 commit comments