Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unskip update tests under java test server #644

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 10 additions & 74 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 @@ -4270,11 +4270,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 @@ -4316,13 +4312,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 @@ -4395,11 +4385,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 @@ -4495,13 +4481,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 @@ -4569,13 +4549,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 @@ -4617,14 +4591,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 @@ -4914,14 +4881,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 @@ -5305,11 +5265,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 @@ -5386,12 +5342,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):
skip_unfinished_handler_tests_in_older_python()
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 @@ -5628,7 +5579,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 @@ -5639,11 +5589,6 @@ async def test_unfinished_handler_on_workflow_termination(
"-cancellation-", "-failure-", "-continue-as-new-"
],
):
skip_unfinished_handler_tests_in_older_python()
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 @@ -5857,12 +5802,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 @@ -5915,10 +5855,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
Loading