Skip to content

Commit

Permalink
Unskip update tests under java test server
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Sep 16, 2024
1 parent 09ac120 commit edd0677
Showing 1 changed file with 10 additions and 72 deletions.
82 changes: 10 additions & 72 deletions tests/worker/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -4245,11 +4245,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:
Expand Down Expand Up @@ -4291,13 +4287,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,
Expand Down Expand Up @@ -4370,11 +4360,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()
Expand Down Expand Up @@ -4419,13 +4405,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
Expand Down Expand Up @@ -4493,13 +4473,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(
Expand Down Expand Up @@ -4539,14 +4513,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,
Expand Down Expand Up @@ -4836,14 +4803,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],
Expand Down Expand Up @@ -5227,11 +5187,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,
Expand Down Expand Up @@ -5302,11 +5258,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()
Expand Down Expand Up @@ -5543,7 +5495,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-"],
Expand All @@ -5554,10 +5505,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,
Expand Down Expand Up @@ -5770,12 +5717,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(
Expand Down Expand Up @@ -5828,10 +5770,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",
Expand Down

0 comments on commit edd0677

Please sign in to comment.