Skip to content

Commit e390b83

Browse files
committed
Fix test. Use sano dev server and add required dynamic config
1 parent 6974250 commit e390b83

2 files changed

Lines changed: 14 additions & 23 deletions

File tree

tests/conftest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,17 @@ async def env(request) -> AsyncGenerator[WorkflowEnvironment, None]:
4242
env_type = request.config.getoption("--workflow-environment")
4343
if env_type == "local":
4444
env = await WorkflowEnvironment.start_local(
45+
dev_server_download_version="v1.7.1-standalone-nexus-operations",
4546
dev_server_extra_args=[
4647
"--dynamic-config-value",
4748
"frontend.enableExecuteMultiOperation=true",
4849
"--dynamic-config-value",
4950
"system.enableEagerWorkflowStart=true",
50-
]
51+
"--dynamic-config-value",
52+
"nexusoperation.enableStandalone=true",
53+
"--dynamic-config-value",
54+
"history.enableChasmCallbacks=true",
55+
],
5156
)
5257
elif env_type == "time-skipping":
5358
env = await WorkflowEnvironment.start_time_skipping()

tests/nexus_standalone_operations/nexus_standalone_operations_test.py

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
import asyncio
2-
import os
31
import uuid
42
from datetime import timedelta
53

6-
import pytest
7-
from temporalio.client import Client, NexusOperationFailureError
8-
from temporalio.service import RPCError
4+
from temporalio.client import Client
95
from temporalio.worker import Worker
106

117
from nexus_standalone_operations.handler import HelloWorkflow, MyNexusServiceHandler
@@ -21,11 +17,6 @@
2117

2218

2319
async def test_nexus_standalone_operations(client: Client):
24-
if not os.getenv("ENABLE_STANDALONE_NEXUS_TESTS"):
25-
pytest.skip(
26-
"Standalone Nexus operations not yet supported by default dev server. Set ENABLE_STANDALONE_NEXUS_TESTS=1 to enable."
27-
)
28-
2920
endpoint_name = f"test-nexus-standalone-{uuid.uuid4()}"
3021

3122
create_response = await create_nexus_endpoint(
@@ -44,19 +35,14 @@ async def test_nexus_standalone_operations(client: Client):
4435
service=MyNexusService, endpoint=endpoint_name
4536
)
4637

47-
# Test sync echo operation (with retry for endpoint propagation)
38+
# Test sync echo operation
4839
echo_result = None
49-
for _ in range(30):
50-
try:
51-
echo_result = await nexus_client.execute_operation(
52-
MyNexusService.echo,
53-
EchoInput(message="test-echo"),
54-
id=str(uuid.uuid4()),
55-
schedule_to_close_timeout=timedelta(seconds=10),
56-
)
57-
break
58-
except (RPCError, NexusOperationFailureError):
59-
await asyncio.sleep(0.5)
40+
echo_result = await nexus_client.execute_operation(
41+
MyNexusService.echo,
42+
EchoInput(message="test-echo"),
43+
id=str(uuid.uuid4()),
44+
schedule_to_close_timeout=timedelta(seconds=10),
45+
)
6046
assert isinstance(echo_result, EchoOutput)
6147
assert echo_result.message == "test-echo"
6248

0 commit comments

Comments
 (0)