51
51
set_number ,
52
52
create_configuration ,
53
53
remove_configuration ,
54
+ wait_ready ,
54
55
)
55
56
56
57
SERVICES = [
@@ -307,6 +308,7 @@ async def test_cms_responses_restore_v16(
307
308
await asyncio .wait_for (
308
309
asyncio .gather (
309
310
cp .start (),
311
+ cp .send_boot_notification (),
310
312
cp .send_start_transaction (12344 ),
311
313
cp .send_meter_periodic_data (),
312
314
),
@@ -325,6 +327,7 @@ async def test_cms_responses_restore_v16(
325
327
await asyncio .wait_for (
326
328
asyncio .gather (
327
329
cp .start (),
330
+ cp .send_boot_notification (),
328
331
cp .send_meter_periodic_data (),
329
332
),
330
333
timeout = 3 ,
@@ -436,8 +439,9 @@ async def test_cms_responses_actions_v16(
436
439
cp = ChargePoint (f"{ cp_id } _client" , ws )
437
440
with contextlib .suppress (asyncio .TimeoutError ):
438
441
cp_task = asyncio .create_task (cp .start ())
439
- await asyncio .sleep (5 )
440
- # Allow charger time to connect bfore running services
442
+ await cp .send_boot_notification ()
443
+ await wait_ready (cs .charge_points [cp_id ])
444
+ # Confirm charger completed post_connect before running services
441
445
await asyncio .wait_for (
442
446
asyncio .gather (
443
447
cp .send_meter_clock_data (),
@@ -494,6 +498,7 @@ async def test_cms_responses_actions_v16(
494
498
await asyncio .wait_for (
495
499
asyncio .gather (
496
500
cp .start (),
501
+ cp .send_boot_notification (),
497
502
cp .send_start_transaction (0 ),
498
503
cp .send_meter_periodic_data (),
499
504
cp .send_main_meter_clock_data (),
@@ -526,6 +531,7 @@ async def test_cms_responses_actions_v16(
526
531
await asyncio .wait_for (
527
532
asyncio .gather (
528
533
cp .start (),
534
+ cp .send_boot_notification (),
529
535
cp .send_start_transaction (0 ),
530
536
cp .send_meter_energy_kwh (),
531
537
cp .send_meter_clock_data (),
@@ -585,8 +591,9 @@ async def test_cms_responses_errors_v16(
585
591
cp = ChargePoint (f"{ cp_id } _client" , ws )
586
592
cp .accept = False
587
593
cp_task = asyncio .create_task (cp .start ())
588
- await asyncio .sleep (5 )
589
- # Allow charger time to reconnect bfore running services
594
+ await cp .send_boot_notification ()
595
+ await wait_ready (cs .charge_points [cp_id ])
596
+ # Confirm charger completed post_connect before running services
590
597
await asyncio .wait_for (
591
598
asyncio .gather (
592
599
cs .charge_points [cp_id ].trigger_boot_notification (),
0 commit comments