durable-workflow 2.15.1__tar.gz → 2.16.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {durable_workflow-2.15.1/src/durable_workflow.egg-info → durable_workflow-2.16.0}/PKG-INFO +1 -1
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/pyproject.toml +3 -3
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/worker.py +75 -2
- {durable_workflow-2.15.1 → durable_workflow-2.16.0/src/durable_workflow.egg-info}/PKG-INFO +1 -1
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow.egg-info/SOURCES.txt +1 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_replay_regression_corpus.py +46 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_sdk_metrics_contract.py +18 -0
- durable_workflow-2.16.0/tests/test_sticky_history_suffix.py +145 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_worker.py +42 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/LICENSE +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/README.md +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/setup.cfg +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/__init__.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_activity_lease.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_activity_process.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_avro.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_cancellation_scope.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_cancellation_scope_history.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_condition_fingerprint.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_cooperative_cancellation.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_failure_reporting.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_metric_routes.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_poll_transport.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_prepared_local_activity.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_query_task_authority.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_sticky_workflow_cache.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_typed_values.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/activity.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/auth_composition.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/cancellation.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/client.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/errors.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/external_storage.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/external_task_input.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/external_task_result.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/history_bundle_verify.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/interceptors.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/invocable.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/metrics.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/nexus.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/py.typed +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/python_conformance.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/replay_clock.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/replay_clock_math.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/replay_conformance.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/replay_verify.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/retry_policy.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/serializer.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/server_compatibility.json +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/sync.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/telemetry.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/telemetry_carrier.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/testing.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/worker_session.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/worker_status.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/workflow.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/workflow_updates_conformance.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow.egg-info/dependency_links.txt +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow.egg-info/entry_points.txt +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow.egg-info/requires.txt +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow.egg-info/top_level.txt +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_activity_cancellation_policies.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_activity_context.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_activity_heartbeat_authority.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_activity_identity.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_activity_lease_authority.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_activity_lease_renewal.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_activity_lease_worker.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_activity_process.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_activity_retry_info.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_auth_composition.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_avro_value_benchmark.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_avro_value_protocol.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_business_replay_clock.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_business_replay_clock_child.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_business_replay_clock_parallel.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_business_replay_clock_redrive.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_business_replay_clock_sequence_claims.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_cancellation_context.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_cancellation_remaining_time.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_cancellation_scope_admission.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_cancellation_scope_authoring.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_cancellation_scope_boundary.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_cancellation_scope_opening.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_child_workflow_policies.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_ci_checkout.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_ci_integration_endpoint.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_client.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_client_iterators.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_client_telemetry.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_client_timeouts.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_codec_regression_corpus.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_committed_cancellation_scope_descendants.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_committed_cancellation_scope_groups.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_committed_cancellation_scope_history.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_committed_cancellation_scope_replay.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_condition_fingerprint.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_condition_occurrence_id.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_condition_replay_drift.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_control_plane_parity_fixtures.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_cooperative_cancellation.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_cooperative_cancellation_client.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_cooperative_cancellation_worker.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_cooperative_remote_worker.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_docs_release_channel.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_docstring_cross_references.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_durable_selection.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_empty_callback_failure.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_errors.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_external_storage.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_external_task_input.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_external_task_result.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_failure_reporting.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_generator_lifecycle.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_golden_history_replay.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_history_bundle_pruned.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_history_bundle_schema2.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_history_bundle_verify.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_history_event_contract.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_invocable.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_local_activity_backoff.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_local_failure_reporting.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_message_streams.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_metric_routes.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_metrics.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_nexus_durable_wait.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_nexus_namespace.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_nexus_wire.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_order_processing_example.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_parallel_completion_order_replay.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_parallel_saga_authoring.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_patch_history.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_pending_operation_replay.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_poll_failure_backoff.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_poll_transport.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_portal_source_split.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_prepared_local_activity_client.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_prepared_local_activity_groups.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_prepared_local_activity_policies.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_prepared_local_activity_worker.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_public_boundary_scanner.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_publish_workflow_isolation.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_pypi_project_surface.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_python_conformance.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_queries.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_query_task_authority.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_query_timeout_retry.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_readme_quickstart.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_redrive_call_ledger.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_redrive_replay.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_redrive_successor_evidence.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_registration_ambiguity.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_release_metadata.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_replay.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_replay_clock.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_replay_conformance.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_replay_verify.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_retry_policy.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_run_activities.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_run_cancellation_scope_replay.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_runtime_external_payload_transport.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_schedules.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_scoped_run_cancellation_context.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_search_attribute_replay_identity.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_serializer.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_signals.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_sleep.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_standalone_activity_client.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_sticky_execution.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_storage_admission.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_sync.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_sync_activities.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_telemetry.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_telemetry_carrier.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_testing_failures.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_testing_harness.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_testing_nexus.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_threaded_heartbeat_example.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_tls_trust.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_transport_diagnostics.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_typed_values.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_typed_workflow_values.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_update_signal_condition_replay.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_updates.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_wait_condition.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_worker_deregistration.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_worker_observation.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_worker_session.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_worker_startup_buffered.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_worker_startup_raw.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_worker_startup_read_budget.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_worker_startup_snapshot.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_worker_status.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_worker_telemetry_wire.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_workflow_entry_arguments.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_workflow_entrypoint_validation.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_workflow_handler_validation.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_workflow_identity.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_workflow_result_timeout.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_workflow_streams.py +0 -0
- {durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_workflow_updates_conformance.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "durable-workflow"
|
|
7
|
-
version = "2.
|
|
7
|
+
version = "2.16.0"
|
|
8
8
|
description = "Python client and worker SDK for Durable Workflow Cloud and self-hosted Server"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -79,8 +79,8 @@ durable-workflow-replay-conformance = "durable_workflow.replay_conformance:main"
|
|
|
79
79
|
durable-workflow-workflow-updates-conformance = "durable_workflow.workflow_updates_conformance:main"
|
|
80
80
|
|
|
81
81
|
[tool.durable-workflow]
|
|
82
|
-
product-train = "2.
|
|
83
|
-
registry-version = "2.
|
|
82
|
+
product-train = "2.16.0"
|
|
83
|
+
registry-version = "2.16.0"
|
|
84
84
|
supported-server-versions = "2.8.0"
|
|
85
85
|
supported-server-release-baselines = { "2" = "2.8.0", "3" = "3.0.0" }
|
|
86
86
|
worker-protocol-version = "1.20"
|
|
@@ -430,6 +430,18 @@ def _signal_arguments_envelope_from_export(
|
|
|
430
430
|
return envelope
|
|
431
431
|
|
|
432
432
|
|
|
433
|
+
def _suffix_continues(events: list[dict[str, Any]], after: int, last: Any) -> bool:
|
|
434
|
+
"""Whether ``events`` run gap-free from ``after + 1`` and end at ``last``."""
|
|
435
|
+
if type(last) is not int or last < after:
|
|
436
|
+
return False
|
|
437
|
+
if any(not isinstance(event, dict) for event in events):
|
|
438
|
+
return False
|
|
439
|
+
sequences = [event.get("sequence") for event in events]
|
|
440
|
+
if any(type(sequence) is not int for sequence in sequences):
|
|
441
|
+
return False
|
|
442
|
+
return sequences == list(range(after + 1, last + 1))
|
|
443
|
+
|
|
444
|
+
|
|
433
445
|
def _history_events_from_query_export(history: Any, history_export: Any) -> Any:
|
|
434
446
|
if isinstance(history, list) and history:
|
|
435
447
|
return history
|
|
@@ -1215,6 +1227,7 @@ class Worker:
|
|
|
1215
1227
|
self._poller_tasks: set[asyncio.Task[Any]] = set()
|
|
1216
1228
|
self._registered = False
|
|
1217
1229
|
self._deregistration_fenced = False
|
|
1230
|
+
self._sticky_history_suffix_supported = False
|
|
1218
1231
|
self._registration_token: str | None = None
|
|
1219
1232
|
self._registration_worker_id: str | None = None
|
|
1220
1233
|
self._registration_namespace: object = None
|
|
@@ -1383,6 +1396,14 @@ class Worker:
|
|
|
1383
1396
|
not isinstance(sticky_support, Mapping) or sticky_support.get("supported") is not True
|
|
1384
1397
|
):
|
|
1385
1398
|
raise RuntimeError("sticky execution requires Server's advertised sticky_execution support")
|
|
1399
|
+
# Server #1017: a sticky worker may take only the history after its cached sequence.
|
|
1400
|
+
suffix_support = (
|
|
1401
|
+
server_capabilities.get("sticky_history_suffix") if isinstance(server_capabilities, Mapping) else None
|
|
1402
|
+
)
|
|
1403
|
+
self._sticky_history_suffix_supported = (
|
|
1404
|
+
self._sticky_cache.enabled and isinstance(suffix_support, Mapping)
|
|
1405
|
+
and suffix_support.get("supported") is True and suffix_support.get("version") == 1
|
|
1406
|
+
)
|
|
1386
1407
|
self._cooperative_cancellation_supported = (
|
|
1387
1408
|
"cooperative_cancellation" in self.capabilities
|
|
1388
1409
|
and isinstance(protocol, Mapping)
|
|
@@ -1485,7 +1506,9 @@ class Worker:
|
|
|
1485
1506
|
capabilities.append("prepared_local_activity_cancellation_policies")
|
|
1486
1507
|
if PORTABLE_WORKER_AFFINITY_CAPABILITY_MANIFEST["worker_sessions"]["supported"]:
|
|
1487
1508
|
capabilities.append("worker_sessions")
|
|
1488
|
-
affinity_manifest
|
|
1509
|
+
affinity_manifest: dict[str, dict[str, Any]] = {
|
|
1510
|
+
name: dict(entry) for name, entry in PORTABLE_WORKER_AFFINITY_CAPABILITY_MANIFEST.items()
|
|
1511
|
+
}
|
|
1489
1512
|
if self._sticky_cache.enabled:
|
|
1490
1513
|
if "sticky_execution" not in capabilities:
|
|
1491
1514
|
capabilities.append("sticky_execution")
|
|
@@ -1494,6 +1517,11 @@ class Worker:
|
|
|
1494
1517
|
"minimum_protocol_version": "1.18",
|
|
1495
1518
|
"implementation": "bounded_durable_history_cache",
|
|
1496
1519
|
}
|
|
1520
|
+
if "sticky_history_suffix" not in capabilities:
|
|
1521
|
+
capabilities.append("sticky_history_suffix")
|
|
1522
|
+
affinity_manifest["sticky_history_suffix"] = {
|
|
1523
|
+
"supported": True, "minimum_protocol_version": "1.18", "version": 1,
|
|
1524
|
+
}
|
|
1497
1525
|
|
|
1498
1526
|
ack = await self.client.register_worker(
|
|
1499
1527
|
worker_id=self.worker_id,
|
|
@@ -1683,6 +1711,9 @@ class Worker:
|
|
|
1683
1711
|
) -> list[dict[str, Any]]:
|
|
1684
1712
|
if first_page_token is not None:
|
|
1685
1713
|
return await self._fetch_workflow_claim_history_pages(task, [], first_page_token)
|
|
1714
|
+
after = task.get("history_after_sequence")
|
|
1715
|
+
if type(after) is int and after > 0:
|
|
1716
|
+
return await self._load_suffix_history(task, after)
|
|
1686
1717
|
inline = list(task.get("history_events", []))
|
|
1687
1718
|
key = self._sticky_cache_key(task)
|
|
1688
1719
|
mode = task.get("sticky_replay_mode")
|
|
@@ -1735,6 +1766,41 @@ class Worker:
|
|
|
1735
1766
|
return history
|
|
1736
1767
|
return await self._fetch_workflow_claim_history_pages(task, inline, task.get("next_history_page_token"))
|
|
1737
1768
|
|
|
1769
|
+
async def _load_suffix_history(self, task: dict[str, Any], after: int) -> list[dict[str, Any]]:
|
|
1770
|
+
"""Replay a sticky_history_suffix v1 answer (server#1017) or refetch full history.
|
|
1771
|
+
|
|
1772
|
+
A suffix is used only on a sticky hit whose cached history ends at exactly
|
|
1773
|
+
``after`` and whose events run gap-free from ``after + 1`` to
|
|
1774
|
+
``history_last_sequence``. It is never treated as a complete history.
|
|
1775
|
+
"""
|
|
1776
|
+
key = self._sticky_cache_key(task)
|
|
1777
|
+
suffix = list(task.get("history_events", []))
|
|
1778
|
+
token = task.get("next_history_page_token")
|
|
1779
|
+
if token is not None:
|
|
1780
|
+
suffix = await self._fetch_workflow_claim_history_pages(task, suffix, token)
|
|
1781
|
+
last = task.get("history_last_sequence")
|
|
1782
|
+
cached = (
|
|
1783
|
+
self._sticky_cache.lookup(key)
|
|
1784
|
+
if key is not None and self._sticky_history_suffix_supported
|
|
1785
|
+
and task.get("sticky_replay_mode") == "sticky_hit_expected" else None
|
|
1786
|
+
)
|
|
1787
|
+
if cached is not None:
|
|
1788
|
+
prefix = cached[0]
|
|
1789
|
+
if prefix and prefix[-1].get("sequence") == after and _suffix_continues(suffix, after, last):
|
|
1790
|
+
history = prefix + suffix
|
|
1791
|
+
if complete_history(history):
|
|
1792
|
+
task["_sticky_resume_token"] = None
|
|
1793
|
+
task["_sticky_resume_offset"] = 0
|
|
1794
|
+
self._sticky_cache.record_replay(hit=True)
|
|
1795
|
+
return history
|
|
1796
|
+
if key is not None:
|
|
1797
|
+
self._sticky_cache.discard(key)
|
|
1798
|
+
self._sticky_cache.record_replay(hit=False, forced=True)
|
|
1799
|
+
history = await self._fetch_workflow_claim_history_pages(task, [], "MA==")
|
|
1800
|
+
if not complete_history(history):
|
|
1801
|
+
raise LocalActivityExecutionAborted("cold replay lacks a complete canonical history prefix")
|
|
1802
|
+
return history
|
|
1803
|
+
|
|
1738
1804
|
async def _fetch_workflow_claim_history_pages(
|
|
1739
1805
|
self, task: dict[str, Any], history: list[dict[str, Any]], token: Any,
|
|
1740
1806
|
) -> list[dict[str, Any]]:
|
|
@@ -1782,12 +1848,16 @@ class Worker:
|
|
|
1782
1848
|
resume_offset=task.get("_sticky_resume_offset", 0),
|
|
1783
1849
|
):
|
|
1784
1850
|
return None
|
|
1785
|
-
|
|
1851
|
+
claim: dict[str, Any] = {
|
|
1786
1852
|
"worker_id": self.worker_id, "workflow_id": key[0], "run_id": key[1], "build_id": key[2],
|
|
1787
1853
|
"ttl_seconds": self._sticky_cache.ttl_seconds,
|
|
1788
1854
|
"metrics": {name: self._sticky_cache.metrics()[name]
|
|
1789
1855
|
for name in ("hit", "miss", "eviction", "forced_cold_replay")},
|
|
1790
1856
|
}
|
|
1857
|
+
if self._sticky_history_suffix_supported:
|
|
1858
|
+
# sticky_history_suffix v1: the Server sends the next suffix after exactly this sequence.
|
|
1859
|
+
claim["history_last_sequence"] = history[-1]["sequence"]
|
|
1860
|
+
return claim
|
|
1791
1861
|
|
|
1792
1862
|
def sticky_cache_metrics(self) -> dict[str, int]:
|
|
1793
1863
|
"""Return replay counters, retained entries and encoded history bytes."""
|
|
@@ -4743,6 +4813,9 @@ class Worker:
|
|
|
4743
4813
|
return True
|
|
4744
4814
|
|
|
4745
4815
|
async def _run_until_activity_task(self, task: dict[str, Any]) -> None:
|
|
4816
|
+
# run_until() dispatches activities here instead of through
|
|
4817
|
+
# _dispatch_activity_task, so record the Server-computed age too (#188).
|
|
4818
|
+
self._record_task_schedule_to_start("activity", task)
|
|
4746
4819
|
task_start = time.perf_counter()
|
|
4747
4820
|
outcome = "error"
|
|
4748
4821
|
self._activity_inflight += 1
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow.egg-info/SOURCES.txt
RENAMED
|
@@ -163,6 +163,7 @@ tests/test_signals.py
|
|
|
163
163
|
tests/test_sleep.py
|
|
164
164
|
tests/test_standalone_activity_client.py
|
|
165
165
|
tests/test_sticky_execution.py
|
|
166
|
+
tests/test_sticky_history_suffix.py
|
|
166
167
|
tests/test_storage_admission.py
|
|
167
168
|
tests/test_sync.py
|
|
168
169
|
tests/test_sync_activities.py
|
|
@@ -543,6 +543,46 @@ def _execute_local_activity_backoff(inputs: Any) -> dict[str, Any]:
|
|
|
543
543
|
|
|
544
544
|
return asyncio.run(run())
|
|
545
545
|
|
|
546
|
+
def _execute_sticky_suffix(inputs: Any) -> list[dict[str, Any]]:
|
|
547
|
+
"""Feed sticky_history_suffix v1 answers (server#1017) to the real worker over a warm
|
|
548
|
+
cache and report what it replays and which authoritative pages it fetched."""
|
|
549
|
+
assert isinstance(inputs, list) and inputs and all(isinstance(item, dict) for item in inputs)
|
|
550
|
+
|
|
551
|
+
def events(sequences: list[int]) -> list[dict[str, Any]]:
|
|
552
|
+
return [{"id": f"event-{sequence}", "sequence": sequence,
|
|
553
|
+
"event_type": "WorkflowStarted" if sequence == 1 else "SideEffectRecorded",
|
|
554
|
+
"payload": {"value": {"number": sequence}}} for sequence in sequences]
|
|
555
|
+
|
|
556
|
+
async def run(scenario: dict[str, Any]) -> dict[str, Any]:
|
|
557
|
+
last = scenario["last"]
|
|
558
|
+
client = AsyncMock(spec=Client)
|
|
559
|
+
client.workflow_task_history.return_value = {
|
|
560
|
+
"history_events": events(list(range(1, last + 1))), "next_history_page_token": None,
|
|
561
|
+
}
|
|
562
|
+
worker = Worker(client, task_queue="queue", worker_id="holder", build_id="build", sticky_cache_capacity=1)
|
|
563
|
+
worker._sticky_history_suffix_supported = True
|
|
564
|
+
assert worker._sticky_cache.remember(
|
|
565
|
+
("workflow", "run", "build"), events(list(range(1, scenario["cached_through"] + 1))),
|
|
566
|
+
)
|
|
567
|
+
history = await worker._load_workflow_claim_history({
|
|
568
|
+
"task_id": "task", "workflow_id": "workflow", "run_id": "run", "workflow_task_attempt": 1,
|
|
569
|
+
"sticky_replay_mode": "sticky_hit_expected", "history_events": events(scenario["suffix"]),
|
|
570
|
+
"history_after_sequence": scenario["after"], "history_last_sequence": last,
|
|
571
|
+
"next_history_page_token": None,
|
|
572
|
+
})
|
|
573
|
+
metrics = worker.sticky_cache_metrics()
|
|
574
|
+
return {
|
|
575
|
+
"type": "sticky_suffix_history",
|
|
576
|
+
"history_sequences": [event["sequence"] for event in history],
|
|
577
|
+
"authoritative_fetch_tokens": [
|
|
578
|
+
call.kwargs["next_history_page_token"] for call in client.workflow_task_history.await_args_list
|
|
579
|
+
],
|
|
580
|
+
"hit": metrics["hit"],
|
|
581
|
+
"forced_cold_replay": metrics["forced_cold_replay"],
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
return [asyncio.run(run(scenario)) for scenario in inputs]
|
|
585
|
+
|
|
546
586
|
def _execute_fixture(fixture: dict[str, Any]) -> list[dict[str, Any]]:
|
|
547
587
|
assert fixture.get("fixture_schema") == FIXTURE_SCHEMA
|
|
548
588
|
assert "python" in fixture.get("bindings", [])
|
|
@@ -553,6 +593,11 @@ def _execute_fixture(fixture: dict[str, Any]) -> list[dict[str, Any]]:
|
|
|
553
593
|
assert isinstance(workflow_type, str) and workflow_type
|
|
554
594
|
if workflow_type == "sdk.observed-worker-replay":
|
|
555
595
|
return _execute_observed_worker_replay(fixture)
|
|
596
|
+
if workflow_type == "sdk.sticky-suffix":
|
|
597
|
+
commands = _execute_sticky_suffix(workflow.get("input"))
|
|
598
|
+
_assert_matches(fixture["command_sequence"], commands, f"{fixture['id']}.command_sequence")
|
|
599
|
+
_assert_matches(fixture["expected"], {"command_sequence": commands}, f"{fixture['id']}.expected")
|
|
600
|
+
return commands
|
|
556
601
|
if workflow_type == "sdk.local-activity-backoff":
|
|
557
602
|
commands = [_execute_local_activity_backoff(workflow.get("input"))]
|
|
558
603
|
_assert_matches(fixture["command_sequence"], commands, f"{fixture['id']}.command_sequence")
|
|
@@ -782,6 +827,7 @@ def test_checked_in_replay_regression_corpus_uses_official_replayer(
|
|
|
782
827
|
if workflow.get("type") in {
|
|
783
828
|
"sdk.replay-conformance-report", "sdk.query-task-dispatch", "sdk.generator-query-task-dispatch",
|
|
784
829
|
"sdk.generator-side-effect-query-task-dispatch", "sdk.observed-worker-replay", "sdk.local-activity-backoff",
|
|
830
|
+
"sdk.sticky-suffix",
|
|
785
831
|
}:
|
|
786
832
|
_execute_fixture(fixture)
|
|
787
833
|
return
|
|
@@ -228,6 +228,24 @@ async def test_dispatch_records_server_ready_age_before_execution(
|
|
|
228
228
|
assert assert_contract(Recorder(recorder.calls[1:]), duration=19.0) == {"worker_task"}
|
|
229
229
|
|
|
230
230
|
|
|
231
|
+
async def test_run_until_activity_records_server_ready_age(monkeypatch: pytest.MonkeyPatch) -> None:
|
|
232
|
+
# run_until() runs activities through _run_until_activity_task, not
|
|
233
|
+
# _dispatch_activity_task; both must record schedule-to-start (#188).
|
|
234
|
+
recorder = Recorder()
|
|
235
|
+
client = Client("https://runtime.example", metrics=recorder)
|
|
236
|
+
client._cluster_info = {"worker_protocol": {"server_capabilities": {"claimed_task_ready_age": True}}}
|
|
237
|
+
worker = Worker(client, task_queue="orders")
|
|
238
|
+
|
|
239
|
+
async def execute(_: object) -> object:
|
|
240
|
+
return "completed"
|
|
241
|
+
|
|
242
|
+
monkeypatch.setattr(worker, "_run_activity_task", execute)
|
|
243
|
+
await worker._run_until_activity_task({"ready_age_ms": 1250})
|
|
244
|
+
assert recorder.calls[0] == (
|
|
245
|
+
"record", SCHEDULE_TO_START, 1.25, {"task_kind": "activity", "task_queue": "orders"},
|
|
246
|
+
)
|
|
247
|
+
|
|
248
|
+
|
|
231
249
|
@pytest.mark.parametrize("kind", ["workflow", "activity"])
|
|
232
250
|
@pytest.mark.parametrize("value", [None, True, False, -1, 9007199254740992, 1.0, float("nan"),
|
|
233
251
|
float("inf"), "private-value", {"private-key": "private-value"}, []])
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"""sticky_history_suffix v1 (server#1017): accept a suffix only when it continues the cache."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any
|
|
6
|
+
from unittest.mock import AsyncMock
|
|
7
|
+
|
|
8
|
+
import pytest
|
|
9
|
+
|
|
10
|
+
from durable_workflow import Client, Worker
|
|
11
|
+
|
|
12
|
+
KEY = ("workflow", "run", "build")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def history(count: int) -> list[dict[str, Any]]:
|
|
16
|
+
return [{"id": f"event-{sequence}", "sequence": sequence,
|
|
17
|
+
"event_type": "WorkflowStarted" if sequence == 1 else "SideEffectRecorded",
|
|
18
|
+
"payload": {"value": {"number": sequence}}} for sequence in range(1, count + 1)]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def suffix_task(events: list[dict[str, Any]], *, after: int, last: int,
|
|
22
|
+
mode: str = "sticky_hit_expected", token: str | None = None) -> dict[str, Any]:
|
|
23
|
+
return {"task_id": "current-task", "workflow_id": "workflow", "run_id": "run",
|
|
24
|
+
"workflow_task_attempt": 2, "history_events": events, "sticky_replay_mode": mode,
|
|
25
|
+
"history_after_sequence": after, "history_last_sequence": last,
|
|
26
|
+
"last_history_sequence": last, "next_history_page_token": token}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def warm_worker(client: Any, cached: int = 4) -> Worker:
|
|
30
|
+
worker = Worker(client, task_queue="q", worker_id="holder", build_id="build", sticky_cache_capacity=2)
|
|
31
|
+
worker._sticky_history_suffix_supported = True
|
|
32
|
+
assert worker._sticky_cache.remember(KEY, history(cached))
|
|
33
|
+
return worker
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def cold_reply(count: int) -> dict[str, Any]:
|
|
37
|
+
return {"history_events": history(count), "next_history_page_token": None}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@pytest.mark.asyncio
|
|
41
|
+
async def test_hit_appends_the_suffix_to_the_cached_prefix() -> None:
|
|
42
|
+
client = AsyncMock(spec=Client)
|
|
43
|
+
worker = warm_worker(client)
|
|
44
|
+
loaded = await worker._load_workflow_claim_history(suffix_task(history(6)[4:], after=4, last=6))
|
|
45
|
+
assert loaded == history(6)
|
|
46
|
+
client.workflow_task_history.assert_not_awaited()
|
|
47
|
+
assert worker.sticky_cache_metrics()["hit"] == 1
|
|
48
|
+
assert worker.sticky_cache_metrics()["forced_cold_replay"] == 0
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
@pytest.mark.asyncio
|
|
52
|
+
@pytest.mark.parametrize(("events", "after", "last"), [
|
|
53
|
+
pytest.param(history(7)[5:], 4, 7, id="gap"),
|
|
54
|
+
pytest.param(history(6)[3:], 4, 6, id="overlap"),
|
|
55
|
+
pytest.param([history(7)[4], history(7)[6]], 4, 7, id="non-contiguous"),
|
|
56
|
+
pytest.param(history(6)[4:5], 4, 6, id="ends-short-of-last"),
|
|
57
|
+
pytest.param(history(6)[4:], 3, 6, id="boundary-differs-from-cache"),
|
|
58
|
+
])
|
|
59
|
+
async def test_suffix_that_does_not_continue_the_cache_refetches_full_history(
|
|
60
|
+
events: list[dict[str, Any]], after: int, last: int,
|
|
61
|
+
) -> None:
|
|
62
|
+
client = AsyncMock(spec=Client)
|
|
63
|
+
client.workflow_task_history.return_value = cold_reply(last)
|
|
64
|
+
worker = warm_worker(client)
|
|
65
|
+
loaded = await worker._load_workflow_claim_history(suffix_task(events, after=after, last=last))
|
|
66
|
+
assert loaded == history(last)
|
|
67
|
+
client.workflow_task_history.assert_awaited_once_with(
|
|
68
|
+
task_id="current-task", next_history_page_token="MA==", lease_owner="holder", workflow_task_attempt=2,
|
|
69
|
+
)
|
|
70
|
+
assert worker.sticky_cache_metrics()["hit"] == 0
|
|
71
|
+
assert worker.sticky_cache_metrics()["forced_cold_replay"] == 1
|
|
72
|
+
assert worker._sticky_cache.lookup(KEY) is None
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
@pytest.mark.asyncio
|
|
76
|
+
async def test_cold_suffix_without_a_cached_prefix_is_never_replayed_as_full_history() -> None:
|
|
77
|
+
client = AsyncMock(spec=Client)
|
|
78
|
+
client.workflow_task_history.return_value = cold_reply(6)
|
|
79
|
+
worker = Worker(client, task_queue="q", worker_id="replacement", build_id="build", sticky_cache_capacity=1)
|
|
80
|
+
worker._sticky_history_suffix_supported = True
|
|
81
|
+
assert await worker._load_workflow_claim_history(suffix_task(history(6)[4:], after=4, last=6)) == history(6)
|
|
82
|
+
assert client.workflow_task_history.await_args.kwargs["next_history_page_token"] == "MA=="
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
@pytest.mark.asyncio
|
|
86
|
+
@pytest.mark.parametrize("mode", ["forced_cold_replay", "cold_replay", None])
|
|
87
|
+
async def test_suffix_outside_a_sticky_hit_refetches(mode: str | None) -> None:
|
|
88
|
+
client = AsyncMock(spec=Client)
|
|
89
|
+
client.workflow_task_history.return_value = cold_reply(6)
|
|
90
|
+
worker = warm_worker(client)
|
|
91
|
+
task = suffix_task(history(6)[4:], after=4, last=6)
|
|
92
|
+
task["sticky_replay_mode"] = mode
|
|
93
|
+
assert await worker._load_workflow_claim_history(task) == history(6)
|
|
94
|
+
assert client.workflow_task_history.await_args.kwargs["next_history_page_token"] == "MA=="
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
@pytest.mark.asyncio
|
|
98
|
+
async def test_empty_suffix_is_a_hit_only_when_nothing_was_appended() -> None:
|
|
99
|
+
client = AsyncMock(spec=Client)
|
|
100
|
+
worker = warm_worker(client)
|
|
101
|
+
assert await worker._load_workflow_claim_history(suffix_task([], after=4, last=4)) == history(4)
|
|
102
|
+
client.workflow_task_history.return_value = cold_reply(5)
|
|
103
|
+
assert await worker._load_workflow_claim_history(suffix_task([], after=4, last=5)) == history(5)
|
|
104
|
+
assert worker.sticky_cache_metrics()["hit"] == 1
|
|
105
|
+
assert worker.sticky_cache_metrics()["forced_cold_replay"] == 1
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
@pytest.mark.asyncio
|
|
109
|
+
async def test_paged_suffix_is_assembled_before_it_is_checked() -> None:
|
|
110
|
+
client = AsyncMock(spec=Client)
|
|
111
|
+
client.workflow_task_history.return_value = {"history_events": history(8)[6:], "next_history_page_token": None}
|
|
112
|
+
worker = warm_worker(client)
|
|
113
|
+
task = suffix_task(history(8)[4:6], after=4, last=8, token="suffix-page-two")
|
|
114
|
+
assert await worker._load_workflow_claim_history(task) == history(8)
|
|
115
|
+
assert client.workflow_task_history.await_args.kwargs["next_history_page_token"] == "suffix-page-two"
|
|
116
|
+
assert worker.sticky_cache_metrics()["hit"] == 1
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
@pytest.mark.asyncio
|
|
120
|
+
async def test_server_without_suffix_support_never_uses_a_suffix() -> None:
|
|
121
|
+
client = AsyncMock(spec=Client)
|
|
122
|
+
client.workflow_task_history.return_value = cold_reply(6)
|
|
123
|
+
worker = warm_worker(client)
|
|
124
|
+
worker._sticky_history_suffix_supported = False
|
|
125
|
+
assert await worker._load_workflow_claim_history(suffix_task(history(6)[4:], after=4, last=6)) == history(6)
|
|
126
|
+
assert client.workflow_task_history.await_args.kwargs["next_history_page_token"] == "MA=="
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
@pytest.mark.asyncio
|
|
130
|
+
async def test_boundary_zero_keeps_the_full_history_path() -> None:
|
|
131
|
+
client = AsyncMock(spec=Client)
|
|
132
|
+
worker = warm_worker(client)
|
|
133
|
+
task = suffix_task(history(6), after=0, last=6, mode="cold_replay")
|
|
134
|
+
assert await worker._load_workflow_claim_history(task) == history(6)
|
|
135
|
+
client.workflow_task_history.assert_not_awaited()
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def test_claim_reports_the_cached_last_sequence_only_with_server_support() -> None:
|
|
139
|
+
worker = Worker(AsyncMock(spec=Client), task_queue="q", build_id="build", sticky_cache_capacity=2)
|
|
140
|
+
task = suffix_task(history(6), after=0, last=6)
|
|
141
|
+
claim = worker._sticky_cache_claim(task, history(6), [{"type": "start_timer"}])
|
|
142
|
+
assert claim is not None and "history_last_sequence" not in claim
|
|
143
|
+
worker._sticky_history_suffix_supported = True
|
|
144
|
+
claim = worker._sticky_cache_claim(task, history(6), [{"type": "start_timer"}])
|
|
145
|
+
assert claim is not None and claim["history_last_sequence"] == 6
|
|
@@ -7,6 +7,7 @@ import logging
|
|
|
7
7
|
import sys
|
|
8
8
|
import threading
|
|
9
9
|
from pathlib import Path
|
|
10
|
+
from typing import Any
|
|
10
11
|
from unittest.mock import AsyncMock, Mock
|
|
11
12
|
|
|
12
13
|
import httpx
|
|
@@ -1253,6 +1254,47 @@ class TestStickyWorkerRegistration:
|
|
|
1253
1254
|
}
|
|
1254
1255
|
await worker.stop()
|
|
1255
1256
|
|
|
1257
|
+
@pytest.mark.asyncio
|
|
1258
|
+
@pytest.mark.parametrize(("server_entry", "expected"), [
|
|
1259
|
+
({"supported": True, "version": 1}, True),
|
|
1260
|
+
({"supported": True, "version": 2}, False),
|
|
1261
|
+
({"supported": False, "version": 1}, False),
|
|
1262
|
+
(None, False),
|
|
1263
|
+
])
|
|
1264
|
+
async def test_enabled_worker_advertises_history_suffix_and_reads_server_support(
|
|
1265
|
+
self, mock_client: AsyncMock, server_entry: dict[str, Any] | None, expected: bool,
|
|
1266
|
+
) -> None:
|
|
1267
|
+
info = compatible_cluster_info()
|
|
1268
|
+
capabilities = info["worker_protocol"]["server_capabilities"] # type: ignore[index]
|
|
1269
|
+
capabilities["sticky_execution"] = {"supported": True}
|
|
1270
|
+
if server_entry is not None:
|
|
1271
|
+
capabilities["sticky_history_suffix"] = server_entry
|
|
1272
|
+
mock_client.get_cluster_info.return_value = info
|
|
1273
|
+
worker = Worker(mock_client, task_queue="q", sticky_cache_capacity=2)
|
|
1274
|
+
await worker._register()
|
|
1275
|
+
registration = mock_client.register_worker.await_args.kwargs
|
|
1276
|
+
assert registration["capabilities"].count("sticky_history_suffix") == 1
|
|
1277
|
+
assert registration["capability_manifest"]["sticky_history_suffix"] == {
|
|
1278
|
+
"supported": True, "minimum_protocol_version": "1.18", "version": 1,
|
|
1279
|
+
}
|
|
1280
|
+
assert worker._sticky_history_suffix_supported is expected
|
|
1281
|
+
await worker.stop()
|
|
1282
|
+
|
|
1283
|
+
@pytest.mark.asyncio
|
|
1284
|
+
async def test_disabled_cache_does_not_advertise_history_suffix(self, mock_client: AsyncMock) -> None:
|
|
1285
|
+
info = compatible_cluster_info()
|
|
1286
|
+
info["worker_protocol"]["server_capabilities"]["sticky_history_suffix"] = { # type: ignore[index]
|
|
1287
|
+
"supported": True, "version": 1,
|
|
1288
|
+
}
|
|
1289
|
+
mock_client.get_cluster_info.return_value = info
|
|
1290
|
+
worker = Worker(mock_client, task_queue="q")
|
|
1291
|
+
await worker._register()
|
|
1292
|
+
registration = mock_client.register_worker.await_args.kwargs
|
|
1293
|
+
assert "sticky_history_suffix" not in registration["capabilities"]
|
|
1294
|
+
assert "sticky_history_suffix" not in registration["capability_manifest"]
|
|
1295
|
+
assert worker._sticky_history_suffix_supported is False
|
|
1296
|
+
await worker.stop()
|
|
1297
|
+
|
|
1256
1298
|
@pytest.mark.asyncio
|
|
1257
1299
|
async def test_enabled_cache_requires_server_support(self, mock_client: AsyncMock) -> None:
|
|
1258
1300
|
worker = Worker(mock_client, task_queue="q", sticky_cache_capacity=2)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_activity_process.py
RENAMED
|
File without changes
|
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_cancellation_scope.py
RENAMED
|
File without changes
|
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_condition_fingerprint.py
RENAMED
|
File without changes
|
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_failure_reporting.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_prepared_local_activity.py
RENAMED
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_query_task_authority.py
RENAMED
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/_sticky_workflow_cache.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/auth_composition.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/external_storage.py
RENAMED
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/external_task_input.py
RENAMED
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/external_task_result.py
RENAMED
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/history_bundle_verify.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/python_conformance.py
RENAMED
|
File without changes
|
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/replay_clock_math.py
RENAMED
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/replay_conformance.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/server_compatibility.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow/telemetry_carrier.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow.egg-info/requires.txt
RENAMED
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/src/durable_workflow.egg-info/top_level.txt
RENAMED
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_activity_cancellation_policies.py
RENAMED
|
File without changes
|
|
File without changes
|
{durable_workflow-2.15.1 → durable_workflow-2.16.0}/tests/test_activity_heartbeat_authority.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|