@@ -192,11 +192,11 @@ def add_signal_entity_action(state: OrchestratorState, id_: df.EntityId, op: str
192
192
state .actions .append ([action ])
193
193
194
194
def add_call_entity_completed_events (
195
- context_builder : ContextBuilder , op : str , instance_id = str , input_ = None , event_id = 0 , is_error = False ):
195
+ context_builder : ContextBuilder , op : str , instance_id = str , input_ = None , event_id = 0 , is_error = False , literal_input = False ):
196
196
context_builder .add_event_sent_event (instance_id , event_id )
197
197
context_builder .add_orchestrator_completed_event ()
198
198
context_builder .add_orchestrator_started_event ()
199
- context_builder .add_event_raised_event (name = "0000" , id_ = 0 , input_ = input_ , is_entity = True , is_error = is_error )
199
+ context_builder .add_event_raised_event (name = "0000" , id_ = 0 , input_ = input_ , is_entity = True , is_error = is_error , literal_input = literal_input )
200
200
201
201
def test_call_entity_sent ():
202
202
context_builder = ContextBuilder ('test_simple_function' )
@@ -289,4 +289,30 @@ def test_call_entity_catch_exception():
289
289
expected_state ._is_done = True
290
290
expected = expected_state .to_json ()
291
291
292
+ assert_orchestration_state_equals (expected , result )
293
+
294
+ def test_timeout_entity_catch_exception ():
295
+ entityId = df .EntityId ("Counter" , "myCounter" )
296
+ context_builder = ContextBuilder ('catch timeout exceptions' )
297
+ add_call_entity_completed_events (
298
+ context_builder ,
299
+ "add" ,
300
+ df .EntityId .get_scheduler_id (entityId ),
301
+ input_ = "Timeout value of 00:02:00 was exceeded by function: Functions.SlowEntity." ,
302
+ event_id = 0 ,
303
+ is_error = False ,
304
+ literal_input = True
305
+ )
306
+
307
+ result = get_orchestration_state_result (
308
+ context_builder , generator_function_catch_entity_exception )
309
+
310
+ expected_state = base_expected_state (
311
+ "Exception thrown"
312
+ )
313
+
314
+ add_call_entity_action (expected_state , entityId , "add" , 3 )
315
+ expected_state ._is_done = True
316
+ expected = expected_state .to_json ()
317
+
292
318
assert_orchestration_state_equals (expected , result )
0 commit comments