Skip to content

Commit

Permalink
README updates and CI fixes (#403)
Browse files Browse the repository at this point in the history
Fixes #59
Fixes #379
  • Loading branch information
cretz authored Oct 24, 2023
1 parent 00878ad commit 4242dfb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ jobs:
- if: ${{ !endsWith(matrix.os, '-arm') }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
# Due to a yet-uninvestigated change in 3.11.6 that breaks the Rust
# linker on Windows, we are pinning 3.11 to 3.11.5 here
python-version: ${{ matrix.python == '3.11' && '3.11.5' || matrix.python }}
- if: ${{ matrix.os == 'ubuntu-arm' }}
uses: deadsnakes/[email protected]
with:
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ Some things to note about the above code:
does the same thing
* Clients can have many more options not shown here (e.g. data converters and interceptors)
* A string can be used instead of the method reference to call a workflow by name (e.g. if defined in another language)
* Clients to not work across forks
* Clients do not work across forks

Clients also provide a shallow copy of their config for use in making slightly different clients backed by the same
connection. For instance, given the `client` above, this is how to have a client in another namespace:
Expand Down Expand Up @@ -732,6 +732,9 @@ The time-skipping `temporalio.testing.WorkflowEnvironment` can be created via th
This internally downloads the Temporal time-skipping test server to a temporary directory if it doesn't already exist,
then starts the test server which has special APIs for skipping time.

**NOTE:** The time-skipping test environment does not work on ARM. The SDK will try to download the x64 binary on macOS
for use with the Intel emulator, but for Linux or Windows ARM there is no proper time-skipping test server at this time.

##### Automatic Time Skipping

Anytime a workflow result is waited on, the time-skipping server automatically advances to the next event it can. To
Expand Down Expand Up @@ -1272,8 +1275,9 @@ Below are known compatibility issues with the Python SDK.
#### gevent Patching

When using `gevent.monkey.patch_all()`, asyncio event loops can get messed up, especially those using custom event loops
like Temporal. See [this gevent issue](https://github.com/gevent/gevent/issues/982) and
[this Python SDK issue](https://github.com/temporalio/sdk-python/issues/59) for more details.
like Temporal. See [this gevent issue](https://github.com/gevent/gevent/issues/982). This is a known incompatibility and
users are encouraged to not use gevent in asyncio applications (including Temporal). But if you must, there is
[a sample](https://github.com/temporalio/samples-python/tree/main/gevent_async) showing how it is possible.

# Development

Expand Down
17 changes: 7 additions & 10 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,10 +910,7 @@ async def test_schedule_backfill(
pytest.skip("Java test server doesn't support schedules")
await assert_no_schedules(client)

# Just in case it's on the minute boundary, move it off
now = datetime.utcnow()
if now.second == 0:
now += timedelta(seconds=1)
begin = datetime(year=2020, month=1, day=20, hour=5)

# Create paused schedule that runs every minute and has two backfills
handle = await client.create_schedule(
Expand All @@ -934,8 +931,8 @@ async def test_schedule_backfill(
),
backfill=[
ScheduleBackfill(
start_at=now - timedelta(minutes=30),
end_at=now - timedelta(minutes=29),
start_at=begin - timedelta(minutes=30),
end_at=begin - timedelta(minutes=29),
overlap=ScheduleOverlapPolicy.ALLOW_ALL,
)
],
Expand All @@ -945,13 +942,13 @@ async def test_schedule_backfill(
# Add two more backfills and and -2m will be deduped
await handle.backfill(
ScheduleBackfill(
start_at=now - timedelta(minutes=4),
end_at=now - timedelta(minutes=2),
start_at=begin - timedelta(minutes=4),
end_at=begin - timedelta(minutes=2),
overlap=ScheduleOverlapPolicy.ALLOW_ALL,
),
ScheduleBackfill(
start_at=now - timedelta(minutes=2),
end_at=now,
start_at=begin - timedelta(minutes=2),
end_at=begin,
overlap=ScheduleOverlapPolicy.ALLOW_ALL,
),
)
Expand Down
3 changes: 1 addition & 2 deletions tests/testing/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ async def test_workflow_env_time_skipping_heartbeat_timeout():
# Check the causes until heartbeat timeout
assert isinstance(err.value.cause, ActivityError)
assert isinstance(err.value.cause.cause, TimeoutError)
assert isinstance(err.value.cause.cause.cause, TimeoutError)
assert err.value.cause.cause.cause.type == TimeoutType.HEARTBEAT
assert err.value.cause.cause.type == TimeoutType.HEARTBEAT


@workflow.defn
Expand Down

0 comments on commit 4242dfb

Please sign in to comment.