@@ -220,15 +220,16 @@ async def test_reconnect_lockup(device, event_loop, make_application, mocker):
220220 await app .shutdown ()
221221
222222
223- @pytest .mark .parametrize ("device" , FORMED_DEVICES )
223+ @pytest .mark .parametrize ("device" , [ FormedLaunchpadCC26X2R1 ] )
224224async def test_reconnect_lockup_pyserial (device , event_loop , make_application , mocker ):
225225 mocker .patch ("zigpy_znp.zigbee.application.WATCHDOG_PERIOD" , 0.1 )
226226
227227 app , znp_server = await make_application (
228228 server_cls = device ,
229229 client_config = {
230230 conf .CONF_ZNP_CONFIG : {
231- conf .CONF_AUTO_RECONNECT_RETRY_DELAY : 0.1 ,
231+ conf .CONF_AUTO_RECONNECT_RETRY_DELAY : 0.01 ,
232+ conf .CONF_SREQ_TIMEOUT : 0.1 ,
232233 }
233234 },
234235 )
@@ -243,20 +244,20 @@ async def test_reconnect_lockup_pyserial(device, event_loop, make_application, m
243244 # We are connected
244245 assert app ._znp is not None
245246
246- did_load_info = asyncio .get_running_loop ().create_future ()
247+ did_start_network = asyncio .get_running_loop ().create_future ()
247248
248- async def patched_load_network_info ( old_load = app .load_network_info , ** kwargs ):
249+ async def patched_start_network ( old_start_network = app .start_network , ** kwargs ):
249250 try :
250- return await old_load (** kwargs )
251+ return await old_start_network (** kwargs )
251252 finally :
252- did_load_info .set_result (True )
253+ did_start_network .set_result (True )
253254
254- with patch .object (app , "load_network_info " , patched_load_network_info ):
255+ with patch .object (app , "start_network " , patched_start_network ):
255256 # "Drop" the connection like PySerial
256257 app ._znp ._uart .connection_lost (exc = None )
257258
258259 # Wait until we are reconnecting
259- await did_load_info
260+ await did_start_network
260261
261262 # "Drop" the connection like PySerial again, but during connect
262263 app ._znp ._uart .connection_lost (exc = None )
0 commit comments