|
44 | 44 | # See https://github.com/temporalio/sdk-python/issues/1704. |
45 | 45 | pytestmark = pytest.mark.requires_local_server |
46 | 46 |
|
47 | | -# Query response links require a newer server than the shared test environment. |
48 | | -_QUERY_LINK_DEV_SERVER_DOWNLOAD_VERSION = "v1.8.3-server-1.32.0-162.0" |
49 | | - |
50 | 47 |
|
51 | 48 | @dataclass |
52 | 49 | class Input: |
@@ -854,14 +851,7 @@ async def run(self, input: Input) -> bool: |
854 | 851 | return await client.execute_operation(TestService.query_op, input.value) |
855 | 852 |
|
856 | 853 |
|
857 | | -async def test_temporal_operation_query_workflow() -> None: |
858 | | - async with await WorkflowEnvironment.start_local( |
859 | | - dev_server_download_version=_QUERY_LINK_DEV_SERVER_DOWNLOAD_VERSION |
860 | | - ) as env: |
861 | | - await _assert_temporal_operation_query_workflow(env.client, env) |
862 | | - |
863 | | - |
864 | | -async def _assert_temporal_operation_query_workflow( |
| 854 | +async def test_temporal_operation_query_workflow( |
865 | 855 | client: Client, env: WorkflowEnvironment |
866 | 856 | ) -> None: |
867 | 857 | task_queue = str(uuid.uuid4()) |
@@ -900,15 +890,17 @@ async def _assert_temporal_operation_query_workflow( |
900 | 890 | target_history = await target_handle.fetch_history() |
901 | 891 | assert not any(event.links for event in target_history.events) |
902 | 892 |
|
903 | | - assert target_handle.result_run_id is not None |
904 | | - assert Link( |
905 | | - workflow=Link.Workflow( |
906 | | - namespace=client.namespace, |
907 | | - workflow_id=target_workflow_id, |
908 | | - run_id=target_handle.result_run_id, |
909 | | - reason="Query processed", |
910 | | - ) |
911 | | - ) in list(completed_event.links) |
| 893 | + # The Java time-skipping test server does not return Nexus operation links. |
| 894 | + if not env.supports_time_skipping: |
| 895 | + assert target_handle.result_run_id is not None |
| 896 | + assert Link( |
| 897 | + workflow=Link.Workflow( |
| 898 | + namespace=client.namespace, |
| 899 | + workflow_id=target_workflow_id, |
| 900 | + run_id=target_handle.result_run_id, |
| 901 | + reason="Query processed", |
| 902 | + ) |
| 903 | + ) in list(completed_event.links) |
912 | 904 | finally: |
913 | 905 | await target_handle.cancel() |
914 | 906 |
|
@@ -1314,14 +1306,8 @@ async def test_temporal_operation_start_activity_raises_error( |
1314 | 1306 | id=str(uuid.uuid4()), |
1315 | 1307 | ) |
1316 | 1308 |
|
1317 | | - operation_err = err.value.__cause__ |
1318 | | - assert isinstance(operation_err, temporalio.exceptions.ApplicationError) |
1319 | | - assert operation_err.type == "OperationError" |
1320 | | - assert "nexus operation completed unsuccessfully" in str(operation_err) |
1321 | | - |
1322 | | - application_err = operation_err.__cause__ |
| 1309 | + application_err = err.value.__cause__ |
1323 | 1310 | assert isinstance(application_err, temporalio.exceptions.ApplicationError) |
1324 | | - |
1325 | 1311 | assert application_err.type == "test-activity-error-type" |
1326 | 1312 | assert "test-activity-error-message" in str(application_err) |
1327 | 1313 | assert application_err.__cause__ is None |
|
0 commit comments