@@ -476,9 +476,7 @@ async def test_dispatch_new_but_finished(
476476 )
477477 fake_time .shift (timedelta (seconds = 1 ))
478478
479- await asyncio .sleep (1 )
480- # Process the lifecycle event caused by the old dispatch at startup
481- await test_env .lifecycle_events .receive ()
479+ # Expecting no event for a past and finished dispatch as it should be filtered out
482480
483481 # Create another dispatch the normal way
484482 new_dispatch = generator .generate_dispatch ()
@@ -514,7 +512,7 @@ async def test_notification_on_actor_start(
514512 running_dispatch ,
515513 active = True ,
516514 duration = timedelta (seconds = 10 ),
517- start_time = _now () - timedelta (seconds = 5 ),
515+ start_time = _now () + timedelta (seconds = 5 ),
518516 recurrence = RecurrenceRule (),
519517 type = "TEST_TYPE" ,
520518 )
@@ -524,7 +522,7 @@ async def test_notification_on_actor_start(
524522 stopped_dispatch ,
525523 active = False ,
526524 duration = timedelta (seconds = 5 ),
527- start_time = _now () - timedelta (seconds = 5 ),
525+ start_time = _now () + timedelta (seconds = 5 ),
528526 recurrence = RecurrenceRule (),
529527 type = "TEST_TYPE" ,
530528 )
@@ -536,8 +534,8 @@ async def test_notification_on_actor_start(
536534 )
537535 test_env .service .start ()
538536
539- fake_time .shift (timedelta (seconds = 1 ))
540- await asyncio .sleep (1 )
537+ fake_time .shift (timedelta (seconds = 7 ))
538+ await asyncio .sleep (6 )
541539
542540 # Expect notification of the running dispatch being ready to run
543541 ready_dispatch = await test_env .running_state_change .receive ()
0 commit comments