Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
- os: ubuntu-latest
python: "3.10"
protoCheckTarget: true
- python: "3.10"
pytestExtraArgs: "--reruns 3 --only-rerun \"RuntimeError: Failed validating workflow\""
- os: ubuntu-arm
runsOn: ubuntu-24.04-arm64-2-core
- os: macos-intel
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ dev = [
"openai-agents>=0.3,<0.5; python_version >= '3.14'",
"openai-agents[litellm]>=0.3,<0.4; python_version < '3.14'",
"googleapis-common-protos==1.70.0",
"pytest-rerunfailures>=16.1",
]

[tool.poe.tasks]
Expand Down
20 changes: 16 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
import pytest
import pytest_asyncio

from temporalio.client import Client
from temporalio.testing import WorkflowEnvironment
from temporalio.worker import SharedStateManager
from tests.helpers.worker import ExternalPythonWorker, ExternalWorker

from . import DEV_SERVER_DOWNLOAD_VERSION

# If there is an integration test environment variable set, we must remove the
Expand Down Expand Up @@ -38,10 +43,6 @@
or protobuf_version.startswith("6.")
), f"Expected protobuf 4.x/5.x/6.x, got {protobuf_version}"

from temporalio.client import Client
from temporalio.testing import WorkflowEnvironment
from tests.helpers.worker import ExternalPythonWorker, ExternalWorker


def pytest_runtest_setup(item):
"""Print a newline so that custom printed output starts on new line."""
Expand Down Expand Up @@ -134,6 +135,17 @@ async def env(env_type: str) -> AsyncGenerator[WorkflowEnvironment, None]:
await env.shutdown()


@pytest.fixture(scope="session")
def shared_state_manager() -> Iterator[SharedStateManager]:
mp_mgr = multiprocessing.Manager()
mgr = SharedStateManager.create_from_multiprocessing(mp_mgr)

try:
yield mgr
finally:
mp_mgr.shutdown()


@pytest.fixture(scope="session")
def mp_fork_ctx() -> Iterator[multiprocessing.context.BaseContext | None]:
mp_ctx = None
Expand Down
Loading
Loading