1212from conductor .client .workflow .executor .workflow_executor import WorkflowExecutor
1313from conductor .client .workflow .task .simple_task import SimpleTask
1414from tests .integration .resources .worker .python .python_worker import *
15+ from tests .integration .retry_helpers import retry_scenario
1516
1617WORKFLOW_NAME = "sdk_python_integration_test_workflow"
1718WORKFLOW_DESCRIPTION = "Python SDK Integration Test"
3637)
3738
3839
39- def run_workflow_execution_tests (configuration : Configuration , workflow_executor : WorkflowExecutor ):
40+ def run_workflow_execution_tests (configuration : Configuration , workflow_executor : WorkflowExecutor ,
41+ deadline = None ):
4042 workers = [
4143 ClassWorker (TASK_NAME ),
4244 ClassWorkerWithDomain (TASK_NAME ),
@@ -59,23 +61,35 @@ def run_workflow_execution_tests(configuration: Configuration, workflow_executor
5961 # (they'd surface as an opaque generic Exception instead). finally cleans up
6062 # on both success and failure while letting the original error propagate.
6163 try :
62- scenario_get_workflow_by_correlation_ids (workflow_executor )
64+ retry_scenario ('scenario_get_workflow_by_correlation_ids' ,
65+ scenario_get_workflow_by_correlation_ids , workflow_executor ,
66+ deadline = deadline )
6367 logger .debug ('finished workflow correlation ids test' )
64- scenario_workflow_registration (workflow_executor )
68+ retry_scenario ('scenario_workflow_registration' ,
69+ scenario_workflow_registration , workflow_executor ,
70+ deadline = deadline )
6571 logger .debug ('finished workflow registration tests' )
66- scenario_workflow_execution (
72+ retry_scenario (
73+ 'scenario_workflow_execution' , scenario_workflow_execution ,
6774 workflow_quantity = 6 ,
6875 workflow_name = WORKFLOW_NAME ,
6976 workflow_executor = workflow_executor ,
70- workflow_completion_timeout = 5.0
77+ workflow_completion_timeout = 5.0 ,
78+ deadline = deadline ,
7179 )
72- scenario_decorated_workers (workflow_executor )
80+ retry_scenario ('scenario_decorated_workers' ,
81+ scenario_decorated_workers , workflow_executor ,
82+ deadline = deadline )
7383 logger .debug ('finished decorated workers tests' )
74- scenario_execute_workflow_async_features (workflow_executor )
84+ retry_scenario ('scenario_execute_workflow_async_features' ,
85+ scenario_execute_workflow_async_features , workflow_executor ,
86+ deadline = deadline )
7587 logger .debug ('finished execute_workflow reactive features tests' )
76- scenario_execute_workflow_error_handling (workflow_executor )
88+ retry_scenario ('scenario_execute_workflow_error_handling' ,
89+ scenario_execute_workflow_error_handling , workflow_executor ,
90+ deadline = deadline )
7791 logger .debug ('finished execute_workflow error handling tests' )
78- run_signal_tests (configuration , workflow_executor )
92+ run_signal_tests (configuration , workflow_executor , deadline = deadline )
7993 logger .debug ('finished signal API tests' )
8094 finally :
8195 task_handler .stop_processes ()
@@ -473,28 +487,44 @@ def _wait_for_workflow_completion(workflow_executor: WorkflowExecutor, workflow_
473487
474488# ===== SIGNAL TESTS =====
475489
476- def run_signal_tests (configuration : Configuration , workflow_executor : WorkflowExecutor ):
477- """Run all signal API tests using WorkflowExecutor methods"""
490+ def run_signal_tests (configuration : Configuration , workflow_executor : WorkflowExecutor ,
491+ deadline = None ):
492+ """Run all signal API tests using WorkflowExecutor methods.
493+
494+ Each scenario is retried at the scenario level on a transient blip (see
495+ retry_scenario): a retry starts a fresh workflow and issues a fresh sync
496+ signal, so the asserted SignalResponse is always from a signal this attempt
497+ actually sent — no double-signalling of a single workflow.
498+ """
478499 logger .info ('START: Signal API tests using WorkflowExecutor' )
479500
480501 try :
481502 # Register signal test workflows (same as original test)
482- _register_signal_test_workflows (workflow_executor )
503+ retry_scenario ('_register_signal_test_workflows' ,
504+ _register_signal_test_workflows , workflow_executor ,
505+ deadline = deadline )
483506
484507 # Test sync signal with different return strategies
485- scenario_signal_target_workflow (workflow_executor )
486- scenario_signal_blocking_workflow (workflow_executor )
487- scenario_signal_blocking_task (workflow_executor )
488- scenario_signal_blocking_task_input (workflow_executor )
508+ retry_scenario ('scenario_signal_target_workflow' ,
509+ scenario_signal_target_workflow , workflow_executor , deadline = deadline )
510+ retry_scenario ('scenario_signal_blocking_workflow' ,
511+ scenario_signal_blocking_workflow , workflow_executor , deadline = deadline )
512+ retry_scenario ('scenario_signal_blocking_task' ,
513+ scenario_signal_blocking_task , workflow_executor , deadline = deadline )
514+ retry_scenario ('scenario_signal_blocking_task_input' ,
515+ scenario_signal_blocking_task_input , workflow_executor , deadline = deadline )
489516
490517 # Test default return strategy
491- scenario_signal_default_strategy (workflow_executor )
518+ retry_scenario ('scenario_signal_default_strategy' ,
519+ scenario_signal_default_strategy , workflow_executor , deadline = deadline )
492520
493521 # Test async signal
494- scenario_signal_async (workflow_executor )
522+ retry_scenario ('scenario_signal_async' ,
523+ scenario_signal_async , workflow_executor , deadline = deadline )
495524
496525 # Test to_dict fix
497- scenario_signal_to_dict_fix (workflow_executor )
526+ retry_scenario ('scenario_signal_to_dict_fix' ,
527+ scenario_signal_to_dict_fix , workflow_executor , deadline = deadline )
498528
499529 logger .info ('All signal tests completed successfully' )
500530
0 commit comments