@@ -2579,16 +2579,31 @@ def test_callback_timeout_scheduling(executor, mock_store, mock_scheduler):
25792579def test_callback_timeout_scheduling_scales_delays (
25802580 executor , mock_store , mock_scheduler , monkeypatch
25812581):
2582- """Test that callback timeout timers honor local time scaling."""
2582+ """Test that callback timeout timers honor local time scaling with a floor ."""
25832583 monkeypatch .setenv ("DURABLE_EXECUTION_TIME_SCALE" , "0.05" )
25842584 callback_options = CallbackOptions (timeout_seconds = 60 , heartbeat_timeout_seconds = 30 )
25852585 executor ._completion_events ["test-arn" ] = Mock ()
25862586
25872587 executor ._schedule_callback_timeouts ("test-arn" , callback_options , "callback-id" )
25882588
25892589 timeout_call , heartbeat_call = mock_scheduler .call_later .call_args_list
2590- assert timeout_call .kwargs ["delay" ] == 3.0
2591- assert heartbeat_call .kwargs ["delay" ] == 1.5
2590+ assert timeout_call .kwargs ["delay" ] == 5.0
2591+ assert heartbeat_call .kwargs ["delay" ] == 5.0
2592+
2593+
2594+ def test_callback_timeout_scheduling_keeps_short_delays (
2595+ executor , mock_store , mock_scheduler , monkeypatch
2596+ ):
2597+ """Test that short callback timeout timers are not inflated by the floor."""
2598+ monkeypatch .setenv ("DURABLE_EXECUTION_TIME_SCALE" , "0.05" )
2599+ callback_options = CallbackOptions (timeout_seconds = 1 , heartbeat_timeout_seconds = 2 )
2600+ executor ._completion_events ["test-arn" ] = Mock ()
2601+
2602+ executor ._schedule_callback_timeouts ("test-arn" , callback_options , "callback-id" )
2603+
2604+ timeout_call , heartbeat_call = mock_scheduler .call_later .call_args_list
2605+ assert timeout_call .kwargs ["delay" ] == 1.0
2606+ assert heartbeat_call .kwargs ["delay" ] == 2.0
25922607
25932608
25942609def test_callback_timeout_cleanup (executor , mock_store ):
@@ -2646,7 +2661,7 @@ def test_callback_heartbeat_timeout_reset(executor, mock_store, mock_scheduler):
26462661def test_callback_heartbeat_timeout_reset_scales_delay (
26472662 executor , mock_store , mock_scheduler , monkeypatch
26482663):
2649- """Test that reset heartbeat timers honor local time scaling."""
2664+ """Test that reset heartbeat timers honor local time scaling with a floor ."""
26502665 monkeypatch .setenv ("DURABLE_EXECUTION_TIME_SCALE" , "0.05" )
26512666 callback_token = CallbackToken (execution_arn = "test-arn" , operation_id = "op-123" )
26522667 callback_id = callback_token .to_str ()
@@ -2665,7 +2680,7 @@ def test_callback_heartbeat_timeout_reset_scales_delay(
26652680 executor ._reset_callback_heartbeat_timeout (callback_id , "test-arn" )
26662681
26672682 mock_scheduler .call_later .assert_called_once ()
2668- assert mock_scheduler .call_later .call_args .kwargs ["delay" ] == 1.5
2683+ assert mock_scheduler .call_later .call_args .kwargs ["delay" ] == 5.0
26692684
26702685
26712686def test_callback_timeout_handlers (executor , mock_store ):
0 commit comments