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
1 change: 1 addition & 0 deletions temporalio/worker/_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ async def _handle_start_activity_task(
store_target = StorageDriverActivityInfo(
id=start.activity_id or None,
type=start.activity_type or None,
run_id=start.run_id or None,
namespace=ns,
)
data_converter = self._data_converter._with_contexts(
Expand Down
19 changes: 13 additions & 6 deletions tests/contrib/aws/s3driver/test_s3driver_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,17 @@ async def test_s3_driver_standalone_activity_input_key(
start_to_close_timeout=timedelta(seconds=5),
)
keys = await _list_keys(aioboto3_client)
# Input and output are the same LARGE bytes, so they deduplicate to one key.
assert len(keys) == 1
# Keyed under the activity, not a workflow.
assert f"/ns/default/at/large_io_activity/ai/{activity_id}/ri/null/" in keys[0]
assert "/wt/" not in keys[0]
# Input and output are the same LARGE bytes but stored under different keys.
assert len(keys) == 2
# Both keyed under the activity, not a workflow.
assert all(
f"/ns/default/at/large_io_activity/ai/{activity_id}/ri/" in k for k in keys
)
assert all("/wt/" not in k for k in keys)
# Client-side store does not have run ID information
assert sum(1 for k in keys if "/ri/null/" in k) == 1
# Worker-side store does have run ID information
assert sum(1 for k in keys if "/ri/null/" not in k) == 1


async def test_s3_driver_standalone_activity_output_key(
Expand All @@ -238,7 +244,8 @@ async def test_s3_driver_standalone_activity_output_key(
keys = await _list_keys(aioboto3_client)
# Only the output is large; keyed under the activity.
assert len(keys) == 1
assert f"/ns/default/at/large_output_activity/ai/{activity_id}/ri/null/" in keys[0]
assert f"/ns/default/at/large_output_activity/ai/{activity_id}/ri/" in keys[0]
assert "/ri/null/" not in keys[0]
assert "/wt/" not in keys[0]


Expand Down
2 changes: 1 addition & 1 deletion tests/worker/test_extstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,7 @@ async def test_store_metadata_standalone_activity(env: WorkflowEnvironment) -> N
assert execute_ctx.target.namespace == client.namespace
assert execute_ctx.target.id == activity_id
assert execute_ctx.target.type == "echo_activity"
assert execute_ctx.target.run_id is None
assert execute_ctx.target.run_id is not None


@workflow.defn
Expand Down
Loading