From dad547e270def0eba454c2635c43f4a7ac8763ce Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Mon, 16 Sep 2024 14:29:11 -0400 Subject: [PATCH] Unskip update tests under java test server --- tests/worker/test_workflow.py | 82 +++++------------------------------ 1 file changed, 10 insertions(+), 72 deletions(-) diff --git a/tests/worker/test_workflow.py b/tests/worker/test_workflow.py index 91eb8c49..2869b85b 100644 --- a/tests/worker/test_workflow.py +++ b/tests/worker/test_workflow.py @@ -1494,7 +1494,7 @@ async def test_workflow_with_codec(client: Client, env: WorkflowEnvironment): await test_workflow_signal_and_query(client) await test_workflow_signal_and_query_errors(client) await test_workflow_simple_activity(client) - await test_workflow_update_handlers_happy(client, env) + await test_workflow_update_handlers_happy(client) class PassThroughCodec(PayloadCodec): @@ -4268,11 +4268,7 @@ def throws_runtime_err(self) -> None: raise RuntimeError("intentional failure") -async def test_workflow_update_handlers_happy(client: Client, env: WorkflowEnvironment): - if env.supports_time_skipping: - pytest.skip( - "Java test server: https://github.com/temporalio/sdk-java/issues/1903" - ) +async def test_workflow_update_handlers_happy(client: Client): async with new_worker( client, UpdateHandlersWorkflow, activities=[say_hello] ) as worker: @@ -4314,13 +4310,7 @@ async def test_workflow_update_handlers_happy(client: Client, env: WorkflowEnvir ) -async def test_workflow_update_handlers_unhappy( - client: Client, env: WorkflowEnvironment -): - if env.supports_time_skipping: - pytest.skip( - "Java test server: https://github.com/temporalio/sdk-java/issues/1903" - ) +async def test_workflow_update_handlers_unhappy(client: Client): async with new_worker(client, UpdateHandlersWorkflow) as worker: handle = await client.start_workflow( UpdateHandlersWorkflow.run, @@ -4393,11 +4383,7 @@ async def test_workflow_update_handlers_unhappy( assert "Rejected" == err.value.cause.message -async def test_workflow_update_task_fails(client: Client, env: WorkflowEnvironment): - if env.supports_time_skipping: - pytest.skip( - "Java test server: https://github.com/temporalio/sdk-java/issues/1903" - ) +async def test_workflow_update_task_fails(client: Client): # Need to not sandbox so behavior can change based on globals async with new_worker( client, UpdateHandlersWorkflow, workflow_runner=UnsandboxedWorkflowRunner() @@ -4442,13 +4428,7 @@ def got_update(self) -> str: return self._got_update -async def test_workflow_update_before_worker_start( - client: Client, env: WorkflowEnvironment -): - if env.supports_time_skipping: - pytest.skip( - "Java test server: https://github.com/temporalio/sdk-java/issues/1903" - ) +async def test_workflow_update_before_worker_start(client: Client): # In order to confirm that all started workflows get updates before the # workflow completes, this test will start a workflow and start an update. # Only then will it start the worker to process both in the task. The @@ -4516,13 +4496,7 @@ async def signal(self) -> None: self._complete_update = True -async def test_workflow_update_separate_handle( - client: Client, env: WorkflowEnvironment -): - if env.supports_time_skipping: - pytest.skip( - "Java test server: https://github.com/temporalio/sdk-java/issues/1903" - ) +async def test_workflow_update_separate_handle(client: Client): async with new_worker(client, UpdateSeparateHandleWorkflow) as worker: # Start the workflow handle = await client.start_workflow( @@ -4562,14 +4536,7 @@ async def do_update(self, sleep: float) -> None: await asyncio.sleep(sleep) -async def test_workflow_update_timeout_or_cancel( - client: Client, env: WorkflowEnvironment -): - if env.supports_time_skipping: - pytest.skip( - "Java test server: https://github.com/temporalio/sdk-java/issues/1903" - ) - +async def test_workflow_update_timeout_or_cancel(client: Client): # Confirm start timeout via short timeout on update w/ no worker running handle = await client.start_workflow( UpdateTimeoutOrCancelWorkflow.run, @@ -4859,14 +4826,7 @@ async def run(self, scenario: FailureTypesScenario) -> None: await super().run(scenario) -async def test_workflow_failure_types_configured( - client: Client, env: WorkflowEnvironment -): - if env.supports_time_skipping: - pytest.skip( - "Java test server: https://github.com/temporalio/sdk-java/issues/1903" - ) - +async def test_workflow_failure_types_configured(client: Client): # Asserter for a single scenario async def assert_scenario( workflow: Type[FailureTypesWorkflowBase], @@ -5250,11 +5210,7 @@ async def get_update_id(self) -> str: return info.id -async def test_workflow_current_update(client: Client, env: WorkflowEnvironment): - if env.supports_time_skipping: - pytest.skip( - "Java test server: https://github.com/temporalio/sdk-java/issues/1903" - ) +async def test_workflow_current_update(client: Client): async with new_worker(client, CurrentUpdateWorkflow) as worker: handle = await client.start_workflow( CurrentUpdateWorkflow.run, @@ -5325,11 +5281,7 @@ async def my_signal_WARN_AND_ABANDON(self): await self._do_update_or_signal() -async def test_unfinished_update_handler(client: Client, env: WorkflowEnvironment): - if env.supports_time_skipping: - pytest.skip( - "Java test server: https://github.com/temporalio/sdk-java/issues/1903" - ) +async def test_unfinished_update_handler(client: Client): async with new_worker(client, UnfinishedHandlersWarningsWorkflow) as worker: test = _UnfinishedHandlersWarningsTest(client, worker, "update") await test.test_wait_all_handlers_finished_and_unfinished_handlers_warning() @@ -5566,7 +5518,6 @@ async def my_dynamic_signal(self, name: str, args: Sequence[RawValue]) -> None: ) async def test_unfinished_handler_on_workflow_termination( client: Client, - env: WorkflowEnvironment, handler_type: Literal["-signal-", "-update-"], handler_registration: Literal["-late-registered-", "-not-late-registered-"], handler_dynamism: Literal["-dynamic-", "-not-dynamic-"], @@ -5577,10 +5528,6 @@ async def test_unfinished_handler_on_workflow_termination( "-cancellation-", "-failure-", "-continue-as-new-" ], ): - if handler_type == "-update-" and env.supports_time_skipping: - pytest.skip( - "Java test server: https://github.com/temporalio/sdk-java/issues/1903" - ) await _UnfinishedHandlersOnWorkflowTerminationTest( client, handler_type, @@ -5793,12 +5740,7 @@ async def my_update(self) -> str: async def test_update_completion_is_honored_when_after_workflow_return_1( client: Client, - env: WorkflowEnvironment, ): - if env.supports_time_skipping: - pytest.skip( - "Java test server: https://github.com/temporalio/sdk-java/issues/1903" - ) update_id = "my-update" task_queue = "tq" wf_handle = await client.start_workflow( @@ -5851,10 +5793,6 @@ async def test_update_completion_is_honored_when_after_workflow_return_2( client: Client, env: WorkflowEnvironment, ): - if env.supports_time_skipping: - pytest.skip( - "Java test server: https://github.com/temporalio/sdk-java/issues/1903" - ) async with Worker( client, task_queue="tq",