@temporalio/core-bridge 1.13.2 → 1.14.0
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.
- package/Cargo.lock +135 -100
- package/Cargo.toml +3 -2
- package/{sdk-core/fsm/rustfsm_trait/LICENSE.txt → LICENSE} +5 -5
- package/README.md +0 -1
- package/bridge-macros/Cargo.toml +16 -0
- package/bridge-macros/src/derive_js_function.rs +126 -0
- package/bridge-macros/src/derive_tryfromjs.rs +138 -0
- package/bridge-macros/src/derive_tryintojs.rs +151 -0
- package/bridge-macros/src/lib.rs +42 -0
- package/lib/native.d.ts +13 -6
- package/package.json +6 -5
- package/releases/aarch64-apple-darwin/index.node +0 -0
- package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
- package/releases/x86_64-apple-darwin/index.node +0 -0
- package/releases/x86_64-pc-windows-msvc/index.node +0 -0
- package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
- package/sdk-core/.cargo/config.toml +9 -3
- package/sdk-core/.github/workflows/per-pr.yml +42 -5
- package/sdk-core/AGENTS.md +17 -19
- package/sdk-core/Cargo.toml +6 -7
- package/sdk-core/README.md +12 -15
- package/sdk-core/arch_docs/diagrams/deps.svg +102 -0
- package/sdk-core/{client → crates/client}/Cargo.toml +7 -9
- package/sdk-core/{client → crates/client}/src/lib.rs +110 -159
- package/sdk-core/{client → crates/client}/src/metrics.rs +1 -1
- package/sdk-core/{client → crates/client}/src/raw.rs +73 -44
- package/sdk-core/crates/client/src/request_extensions.rs +40 -0
- package/sdk-core/{client → crates/client}/src/retry.rs +24 -17
- package/sdk-core/crates/client/src/worker/mod.rs +1468 -0
- package/sdk-core/{client → crates/client}/src/workflow_handle/mod.rs +4 -4
- package/sdk-core/{core-api → crates/common}/Cargo.toml +17 -8
- package/sdk-core/crates/common/protos/api_cloud_upstream/VERSION +1 -0
- package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/account/v1/message.proto +18 -0
- package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/request_response.proto +38 -11
- package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/service.proto +21 -4
- package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/operation/v1/message.proto +6 -6
- package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/sink/v1/message.proto +22 -0
- package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/create-release.yml +5 -0
- package/sdk-core/{core-api → crates/common}/src/envconfig.rs +2 -2
- package/sdk-core/{core-api → crates/common}/src/errors.rs +8 -1
- package/sdk-core/{fsm/rustfsm_trait/src/lib.rs → crates/common/src/fsm_trait.rs} +1 -27
- package/sdk-core/{core-api → crates/common}/src/lib.rs +24 -9
- package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/canned_histories.rs +1 -1
- package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/history_builder.rs +1 -1
- package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/history_info.rs +2 -2
- package/sdk-core/{sdk-core-protos/src/lib.rs → crates/common/src/protos/mod.rs} +18 -17
- package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/test_utils.rs +1 -1
- package/sdk-core/{core-api → crates/common}/src/telemetry/metrics.rs +447 -50
- package/sdk-core/{core-api → crates/common}/src/telemetry.rs +3 -1
- package/sdk-core/{core-api → crates/common}/src/worker.rs +112 -18
- package/sdk-core/crates/common/tests/worker_task_types_test.rs +129 -0
- package/sdk-core/crates/macros/Cargo.toml +23 -0
- package/sdk-core/{fsm/rustfsm_procmacro → crates/macros}/src/lib.rs +6 -11
- package/sdk-core/{sdk → crates/sdk}/Cargo.toml +10 -10
- package/sdk-core/{sdk → crates/sdk}/src/activity_context.rs +8 -6
- package/sdk-core/{sdk → crates/sdk}/src/interceptors.rs +1 -1
- package/sdk-core/{sdk → crates/sdk}/src/lib.rs +42 -37
- package/sdk-core/{sdk → crates/sdk}/src/workflow_context/options.rs +2 -2
- package/sdk-core/{sdk → crates/sdk}/src/workflow_context.rs +21 -19
- package/sdk-core/{sdk → crates/sdk}/src/workflow_future.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/Cargo.toml +32 -25
- package/sdk-core/{tests → crates/sdk-core/benches}/workflow_replay_bench.rs +10 -10
- package/sdk-core/crates/sdk-core/machine_coverage/ActivityMachine_Coverage.puml +32 -0
- package/sdk-core/crates/sdk-core/machine_coverage/CancelExternalMachine_Coverage.puml +9 -0
- package/sdk-core/crates/sdk-core/machine_coverage/CancelWorkflowMachine_Coverage.puml +6 -0
- package/sdk-core/crates/sdk-core/machine_coverage/ChildWorkflowMachine_Coverage.puml +27 -0
- package/sdk-core/crates/sdk-core/machine_coverage/CompleteWorkflowMachine_Coverage.puml +6 -0
- package/sdk-core/crates/sdk-core/machine_coverage/ContinueAsNewWorkflowMachine_Coverage.puml +6 -0
- package/sdk-core/crates/sdk-core/machine_coverage/FailWorkflowMachine_Coverage.puml +6 -0
- package/sdk-core/crates/sdk-core/machine_coverage/LocalActivityMachine_Coverage.puml +23 -0
- package/sdk-core/crates/sdk-core/machine_coverage/ModifyWorkflowPropertiesMachine_Coverage.puml +5 -0
- package/sdk-core/crates/sdk-core/machine_coverage/PatchMachine_Coverage.puml +8 -0
- package/sdk-core/crates/sdk-core/machine_coverage/SignalExternalMachine_Coverage.puml +12 -0
- package/sdk-core/crates/sdk-core/machine_coverage/TimerMachine_Coverage.puml +13 -0
- package/sdk-core/crates/sdk-core/machine_coverage/UpdateMachine_Coverage.puml +19 -0
- package/sdk-core/crates/sdk-core/machine_coverage/UpsertSearchAttributesMachine_Coverage.puml +5 -0
- package/sdk-core/crates/sdk-core/machine_coverage/WorkflowTaskMachine_Coverage.puml +11 -0
- package/sdk-core/{core → crates/sdk-core}/src/abstractions.rs +62 -6
- package/sdk-core/crates/sdk-core/src/antithesis.rs +60 -0
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/activity_tasks.rs +36 -31
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/mod.rs +12 -9
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/queries.rs +24 -21
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/replay_flag.rs +10 -8
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/updates.rs +17 -15
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/workers.rs +242 -17
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/workflow_cancels.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/core_tests/workflow_tasks.rs +126 -39
- package/sdk-core/{core → crates/sdk-core}/src/debug_client.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/ephemeral_server/mod.rs +3 -3
- package/sdk-core/crates/sdk-core/src/histfetch.rs +33 -0
- package/sdk-core/{core → crates/sdk-core}/src/internal_flags.rs +4 -3
- package/sdk-core/{core → crates/sdk-core}/src/lib.rs +85 -43
- package/sdk-core/{core → crates/sdk-core}/src/pollers/mod.rs +8 -6
- package/sdk-core/{core → crates/sdk-core}/src/pollers/poll_buffer.rs +51 -16
- package/sdk-core/{core → crates/sdk-core}/src/protosext/mod.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/protosext/protocol_messages.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/replay/mod.rs +14 -11
- package/sdk-core/{core → crates/sdk-core}/src/retry_logic.rs +19 -1
- package/sdk-core/{core → crates/sdk-core}/src/telemetry/log_export.rs +2 -2
- package/sdk-core/{core → crates/sdk-core}/src/telemetry/metrics.rs +80 -34
- package/sdk-core/{core → crates/sdk-core}/src/telemetry/mod.rs +4 -4
- package/sdk-core/{core → crates/sdk-core}/src/telemetry/otel.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/telemetry/prometheus_meter.rs +13 -13
- package/sdk-core/{core → crates/sdk-core}/src/telemetry/prometheus_server.rs +2 -2
- package/sdk-core/{core → crates/sdk-core}/src/test_help/integ_helpers.rs +127 -40
- package/sdk-core/{core → crates/sdk-core}/src/test_help/unit_helpers.rs +13 -11
- package/sdk-core/{core → crates/sdk-core}/src/worker/activities/activity_heartbeat_manager.rs +2 -2
- package/sdk-core/{core → crates/sdk-core}/src/worker/activities/local_activities.rs +14 -12
- package/sdk-core/{core → crates/sdk-core}/src/worker/activities.rs +21 -12
- package/sdk-core/{core → crates/sdk-core}/src/worker/client/mocks.rs +25 -12
- package/sdk-core/{core → crates/sdk-core}/src/worker/client.rs +164 -71
- package/sdk-core/crates/sdk-core/src/worker/heartbeat.rs +246 -0
- package/sdk-core/crates/sdk-core/src/worker/mod.rs +1462 -0
- package/sdk-core/{core → crates/sdk-core}/src/worker/nexus.rs +15 -14
- package/sdk-core/{core → crates/sdk-core}/src/worker/slot_provider.rs +12 -13
- package/sdk-core/{core → crates/sdk-core}/src/worker/tuner/fixed_size.rs +5 -1
- package/sdk-core/{core → crates/sdk-core}/src/worker/tuner/resource_based.rs +453 -57
- package/sdk-core/{core → crates/sdk-core}/src/worker/tuner.rs +21 -4
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/driven_workflow.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/history_update.rs +2 -2
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/activity_state_machine.rs +147 -37
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/cancel_external_state_machine.rs +8 -9
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/cancel_nexus_op_state_machine.rs +14 -12
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/cancel_workflow_state_machine.rs +6 -7
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/child_workflow_state_machine.rs +31 -37
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/complete_workflow_state_machine.rs +13 -8
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/continue_as_new_workflow_state_machine.rs +6 -7
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/fail_workflow_state_machine.rs +6 -7
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/local_activity_state_machine.rs +33 -30
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/mod.rs +22 -17
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/modify_workflow_properties_state_machine.rs +4 -3
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/nexus_operation_state_machine.rs +20 -22
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/patch_state_machine.rs +12 -11
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/signal_external_state_machine.rs +9 -12
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/timer_state_machine.rs +26 -13
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/transition_coverage.rs +1 -2
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/update_state_machine.rs +19 -13
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +20 -18
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/workflow_machines/local_acts.rs +1 -1
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/workflow_machines.rs +61 -70
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/machines/workflow_task_state_machine.rs +13 -15
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/managed_run.rs +55 -37
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/mod.rs +166 -60
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/run_cache.rs +10 -7
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/wft_extraction.rs +4 -2
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/wft_poller.rs +15 -4
- package/sdk-core/{core → crates/sdk-core}/src/worker/workflow/workflow_stream.rs +30 -16
- package/sdk-core/{tests → crates/sdk-core/tests}/c_bridge_smoke_test.c +1 -1
- package/sdk-core/{tests → crates/sdk-core/tests}/cloud_tests.rs +1 -1
- package/sdk-core/crates/sdk-core/tests/common/fake_grpc_server.rs +106 -0
- package/sdk-core/{tests → crates/sdk-core/tests}/common/http_proxy.rs +1 -1
- package/sdk-core/{tests → crates/sdk-core/tests}/common/mod.rs +93 -74
- package/sdk-core/{tests → crates/sdk-core/tests}/common/workflows.rs +4 -3
- package/sdk-core/crates/sdk-core/tests/fsm_procmacro.rs +6 -0
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/dupe_transitions_fail.rs +1 -3
- package/sdk-core/crates/sdk-core/tests/fsm_trybuild/dupe_transitions_fail.stderr +12 -0
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/dynamic_dest_pass.rs +2 -4
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/forgot_name_fail.rs +1 -3
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/forgot_name_fail.stderr +4 -4
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/handler_arg_pass.rs +2 -4
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/handler_pass.rs +2 -4
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/medium_complex_pass.rs +2 -4
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/no_handle_conversions_require_into_fail.rs +2 -4
- package/sdk-core/crates/sdk-core/tests/fsm_trybuild/no_handle_conversions_require_into_fail.stderr +15 -0
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/simple_pass.rs +2 -4
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/struct_event_variant_fail.rs +1 -3
- package/sdk-core/crates/sdk-core/tests/fsm_trybuild/struct_event_variant_fail.stderr +5 -0
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/tuple_more_item_event_variant_fail.rs +1 -3
- package/sdk-core/crates/sdk-core/tests/fsm_trybuild/tuple_more_item_event_variant_fail.stderr +5 -0
- package/sdk-core/{fsm/rustfsm_procmacro/tests/trybuild → crates/sdk-core/tests/fsm_trybuild}/tuple_zero_item_event_variant_fail.rs +1 -3
- package/sdk-core/crates/sdk-core/tests/fsm_trybuild/tuple_zero_item_event_variant_fail.stderr +5 -0
- package/sdk-core/{tests → crates/sdk-core/tests}/global_metric_tests.rs +14 -15
- package/sdk-core/{tests → crates/sdk-core/tests/heavy_tests}/fuzzy_workflow.rs +3 -3
- package/sdk-core/{tests → crates/sdk-core/tests}/heavy_tests.rs +19 -12
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/activity_functions.rs +1 -1
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/client_tests.rs +16 -111
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/ephemeral_server_tests.rs +5 -6
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/heartbeat_tests.rs +23 -19
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/metrics_tests.rs +134 -60
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/pagination_tests.rs +4 -4
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/polling_tests.rs +37 -36
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/queries_tests.rs +12 -10
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/update_tests.rs +41 -29
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/visibility_tests.rs +24 -19
- package/sdk-core/crates/sdk-core/tests/integ_tests/worker_heartbeat_tests.rs +1061 -0
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/worker_tests.rs +113 -51
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/worker_versioning_tests.rs +19 -17
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/activities.rs +35 -30
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/appdata_propagation.rs +3 -3
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/cancel_external.rs +14 -9
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/cancel_wf.rs +13 -8
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/child_workflows.rs +48 -35
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/continue_as_new.rs +14 -9
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/determinism.rs +24 -15
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/eager.rs +9 -4
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/local_activities.rs +47 -47
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/modify_wf_properties.rs +16 -11
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/nexus.rs +51 -23
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/patches.rs +22 -10
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/replay.rs +19 -17
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/resets.rs +14 -5
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/signals.rs +24 -15
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/stickyness.rs +8 -6
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/timers.rs +28 -18
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/upsert_search_attrs.rs +18 -13
- package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests.rs +46 -41
- package/sdk-core/{tests → crates/sdk-core/tests}/main.rs +15 -9
- package/sdk-core/{tests → crates/sdk-core/tests}/manual_tests.rs +20 -14
- package/sdk-core/{tests → crates/sdk-core/tests}/runner.rs +2 -2
- package/sdk-core/{tests → crates/sdk-core/tests}/shared_tests/mod.rs +10 -5
- package/sdk-core/{tests → crates/sdk-core/tests}/shared_tests/priority.rs +5 -5
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/Cargo.toml +13 -10
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/include/temporal-sdk-core-c-bridge.h +32 -23
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/client.rs +55 -32
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/envconfig.rs +1 -1
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/lib.rs +1 -1
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/metric.rs +1 -1
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/runtime.rs +24 -9
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/testing.rs +1 -1
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/tests/context.rs +11 -10
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/tests/mod.rs +7 -7
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/tests/utils.rs +3 -4
- package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/worker.rs +111 -58
- package/sdk-core/docker-cgroup-tests.sh +24 -0
- package/sdk-core/{docker → etc/docker}/docker-compose-ci.yaml +9 -9
- package/sdk-core/{docker → etc/docker}/docker-compose-telem.yaml +11 -11
- package/sdk-core/{docker → etc/docker}/docker-compose.yaml +8 -8
- package/sdk-core/{integ-with-otel.sh → etc/integ-with-otel.sh} +1 -1
- package/sdk-core/etc/regen-depgraph.sh +2 -2
- package/src/client.rs +24 -33
- package/src/helpers/try_from_js.rs +1 -1
- package/src/logs.rs +1 -1
- package/src/metrics.rs +3 -3
- package/src/runtime.rs +42 -28
- package/src/testing.rs +3 -3
- package/src/worker.rs +70 -36
- package/ts/native.ts +13 -6
- package/LICENSE.md +0 -23
- package/sdk-core/client/src/worker_registry/mod.rs +0 -282
- package/sdk-core/core/src/worker/heartbeat.rs +0 -230
- package/sdk-core/core/src/worker/mod.rs +0 -990
- package/sdk-core/etc/deps.svg +0 -162
- package/sdk-core/fsm/Cargo.toml +0 -21
- package/sdk-core/fsm/README.md +0 -3
- package/sdk-core/fsm/rustfsm_procmacro/Cargo.toml +0 -27
- package/sdk-core/fsm/rustfsm_procmacro/LICENSE.txt +0 -21
- package/sdk-core/fsm/rustfsm_procmacro/tests/progress.rs +0 -8
- package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/dupe_transitions_fail.stderr +0 -12
- package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/no_handle_conversions_require_into_fail.stderr +0 -15
- package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/struct_event_variant_fail.stderr +0 -5
- package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/tuple_more_item_event_variant_fail.stderr +0 -5
- package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/tuple_zero_item_event_variant_fail.stderr +0 -5
- package/sdk-core/fsm/rustfsm_trait/Cargo.toml +0 -14
- package/sdk-core/fsm/src/lib.rs +0 -2
- package/sdk-core/sdk-core-protos/Cargo.toml +0 -37
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/VERSION +0 -1
- /package/sdk-core/{client → crates/client}/src/callback_based.rs +0 -0
- /package/sdk-core/{client → crates/client}/src/proxy.rs +0 -0
- /package/sdk-core/{client → crates/client}/src/replaceable.rs +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/build.rs +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/.github/workflows/build.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/.github/workflows/push-to-buf.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/CODEOWNERS +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/LICENSE +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/Makefile +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/README.md +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/buf.gen.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/buf.lock +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/buf.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/connectivityrule/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/identity/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/namespace/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/nexus/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/region/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/resource/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_cloud_upstream/temporal/api/cloud/usage/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/CODEOWNERS +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/ci.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/publish-docs.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/push-to-buf.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/trigger-api-go-delete-release.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/trigger-api-go-publish-release.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/.github/workflows/trigger-api-go-update.yml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/LICENSE +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/Makefile +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/README.md +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/api-linter.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/buf.gen.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/buf.lock +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/buf.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/api/annotations.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/api/http.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/any.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/descriptor.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/duration.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/empty.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/struct.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/timestamp.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/google/protobuf/wrappers.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/openapi/openapiv2.json +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/openapi/openapiv3.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/openapi/payload_description.txt +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/activity/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/batch/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/command/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/common/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/deployment/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/batch_operation.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/command_type.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/common.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/deployment.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/event_type.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/namespace.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/nexus.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/query.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/reset.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/schedule.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/task_queue.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/update.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/enums/v1/workflow.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/errordetails/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/export/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/failure/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/filter/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/history/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/namespace/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/nexus/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/operatorservice/v1/request_response.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/operatorservice/v1/service.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/protocol/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/query/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/replication/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/rules/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/schedule/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/sdk/v1/enhanced_stack_trace.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/sdk/v1/task_complete_metadata.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/sdk/v1/user_metadata.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/sdk/v1/worker_config.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/sdk/v1/workflow_metadata.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/taskqueue/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/update/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/version/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/worker/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/workflow/v1/message.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/google/rpc/status.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/grpc/health/v1/health.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/activity_result/activity_result.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/activity_task/activity_task.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/child_workflow/child_workflow.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/common/common.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/core_interface.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/external_data/external_data.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/nexus/nexus.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/local/temporal/sdk/core/workflow_completion/workflow_completion.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/testsrv_upstream/Makefile +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/testsrv_upstream/api-linter.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/testsrv_upstream/buf.yaml +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/testsrv_upstream/temporal/api/testservice/v1/request_response.proto +0 -0
- /package/sdk-core/{sdk-core-protos → crates/common}/protos/testsrv_upstream/temporal/api/testservice/v1/service.proto +0 -0
- /package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/constants.rs +0 -0
- /package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/task_token.rs +0 -0
- /package/sdk-core/{sdk-core-protos/src → crates/common/src/protos}/utilities.rs +0 -0
- /package/sdk-core/{fsm → crates/macros}/LICENSE.txt +0 -0
- /package/sdk-core/{sdk → crates/sdk}/src/app_data.rs +0 -0
- /package/sdk-core/{core → crates/sdk-core}/src/abstractions/take_cell.rs +0 -0
- /package/sdk-core/{core → crates/sdk-core}/src/test_help/mod.rs +0 -0
- /package/sdk-core/{core → crates/sdk-core}/src/worker/slot_supplier.rs +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/ends_empty_wft_complete.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/evict_while_la_running_no_interference-16_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/evict_while_la_running_no_interference-23_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/evict_while_la_running_no_interference-85_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/fail_wf_task.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/long_local_activity_with_update-0_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/long_local_activity_with_update-1_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/long_local_activity_with_update-2_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/long_local_activity_with_update-3_history.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/old_change_marker_format.bin +0 -0
- /package/sdk-core/{histories → crates/sdk-core/tests/histories}/timer_workflow_history.bin +0 -0
- /package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/priority.rs +0 -0
- /package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/build.rs +0 -0
- /package/sdk-core/{core-c-bridge → crates/sdk-core-c-bridge}/src/random.rs +0 -0
- /package/sdk-core/{cargo-tokio-console.sh → etc/cargo-tokio-console.sh} +0 -0
|
@@ -3,23 +3,26 @@ use std::{
|
|
|
3
3
|
sync::atomic::{AtomicBool, AtomicUsize, Ordering},
|
|
4
4
|
time::Duration,
|
|
5
5
|
};
|
|
6
|
-
use
|
|
7
|
-
use
|
|
6
|
+
use temporalio_client::WorkflowOptions;
|
|
7
|
+
use temporalio_common::{
|
|
8
|
+
protos::{
|
|
9
|
+
DEFAULT_ACTIVITY_TYPE, TestHistoryBuilder, canned_histories,
|
|
10
|
+
coresdk::AsJsonPayloadExt,
|
|
11
|
+
temporal::api::{
|
|
12
|
+
enums::v1::{EventType, WorkflowTaskFailedCause},
|
|
13
|
+
failure::v1::Failure,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
worker::WorkerTaskTypes,
|
|
17
|
+
};
|
|
18
|
+
use temporalio_sdk::{
|
|
8
19
|
ActContext, ActivityOptions, ChildWorkflowOptions, LocalActivityOptions, WfContext,
|
|
9
20
|
WorkflowResult,
|
|
10
21
|
};
|
|
11
|
-
use
|
|
22
|
+
use temporalio_sdk_core::{
|
|
12
23
|
replay::DEFAULT_WORKFLOW_TYPE,
|
|
13
24
|
test_help::{CoreInternalFlags, MockPollCfg, ResponseType, mock_worker_client},
|
|
14
25
|
};
|
|
15
|
-
use temporal_sdk_core_protos::{
|
|
16
|
-
DEFAULT_ACTIVITY_TYPE, TestHistoryBuilder, canned_histories,
|
|
17
|
-
coresdk::AsJsonPayloadExt,
|
|
18
|
-
temporal::api::{
|
|
19
|
-
enums::v1::{EventType, WorkflowTaskFailedCause},
|
|
20
|
-
failure::v1::Failure,
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
26
|
|
|
24
27
|
static RUN_CT: AtomicUsize = AtomicUsize::new(1);
|
|
25
28
|
|
|
@@ -52,7 +55,9 @@ pub(crate) async fn timer_wf_nondeterministic(ctx: WfContext) -> WorkflowResult<
|
|
|
52
55
|
async fn test_determinism_error_then_recovers() {
|
|
53
56
|
let wf_name = "test_determinism_error_then_recovers";
|
|
54
57
|
let mut starter = CoreWfStarter::new(wf_name);
|
|
55
|
-
starter
|
|
58
|
+
starter
|
|
59
|
+
.worker_config
|
|
60
|
+
.task_types(WorkerTaskTypes::workflow_only());
|
|
56
61
|
let mut worker = starter.worker().await;
|
|
57
62
|
|
|
58
63
|
worker.register_wf(wf_name.to_owned(), timer_wf_nondeterministic);
|
|
@@ -121,11 +126,15 @@ async fn test_panic_wf_task_rejected_properly() {
|
|
|
121
126
|
let t = canned_histories::workflow_fails_with_failure_after_timer("1");
|
|
122
127
|
let mock = mock_worker_client();
|
|
123
128
|
let mut mh = MockPollCfg::from_resp_batches(wf_id, t, [1, 2, 2], mock);
|
|
124
|
-
// We should see one wft failure which has
|
|
129
|
+
// We should see one wft failure which has the default cause, since panics don't have a defined
|
|
125
130
|
// type.
|
|
126
131
|
mh.num_expected_fails = 1;
|
|
127
|
-
mh.expect_fail_wft_matcher =
|
|
128
|
-
|
|
132
|
+
mh.expect_fail_wft_matcher = Box::new(|_, cause, _| {
|
|
133
|
+
matches!(
|
|
134
|
+
cause,
|
|
135
|
+
WorkflowTaskFailedCause::WorkflowWorkerUnhandledFailure
|
|
136
|
+
)
|
|
137
|
+
});
|
|
129
138
|
let mut worker = mock_sdk(mh);
|
|
130
139
|
|
|
131
140
|
worker.register_wf(wf_type.to_owned(), timer_wf_fails_once);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
use crate::common::{CoreWfStarter, NAMESPACE, get_integ_server_options};
|
|
2
2
|
use std::time::Duration;
|
|
3
|
-
use
|
|
4
|
-
use
|
|
3
|
+
use temporalio_client::WorkflowClientTrait;
|
|
4
|
+
use temporalio_common::worker::WorkerTaskTypes;
|
|
5
|
+
use temporalio_sdk::{WfContext, WorkflowResult};
|
|
5
6
|
|
|
6
7
|
pub(crate) async fn eager_wf(_context: WfContext) -> WorkflowResult<()> {
|
|
7
8
|
Ok(().into())
|
|
@@ -14,7 +15,9 @@ async fn eager_wf_start() {
|
|
|
14
15
|
starter.workflow_options.enable_eager_workflow_start = true;
|
|
15
16
|
// hang the test if eager task dispatch failed
|
|
16
17
|
starter.workflow_options.task_timeout = Some(Duration::from_secs(1500));
|
|
17
|
-
starter
|
|
18
|
+
starter
|
|
19
|
+
.worker_config
|
|
20
|
+
.task_types(WorkerTaskTypes::workflow_only());
|
|
18
21
|
let mut worker = starter.worker().await;
|
|
19
22
|
worker.register_wf(wf_name.to_owned(), eager_wf);
|
|
20
23
|
starter.eager_start_with_worker(wf_name, &mut worker).await;
|
|
@@ -28,7 +31,9 @@ async fn eager_wf_start_different_clients() {
|
|
|
28
31
|
starter.workflow_options.enable_eager_workflow_start = true;
|
|
29
32
|
// hang the test if wf task needs retry
|
|
30
33
|
starter.workflow_options.task_timeout = Some(Duration::from_secs(1500));
|
|
31
|
-
starter
|
|
34
|
+
starter
|
|
35
|
+
.worker_config
|
|
36
|
+
.task_types(WorkerTaskTypes::workflow_only());
|
|
32
37
|
let mut worker = starter.worker().await;
|
|
33
38
|
worker.register_wf(wf_name.to_owned(), eager_wf);
|
|
34
39
|
|
package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/local_activities.rs
RENAMED
|
@@ -16,13 +16,43 @@ use std::{
|
|
|
16
16
|
},
|
|
17
17
|
time::{Duration, Instant, SystemTime},
|
|
18
18
|
};
|
|
19
|
-
use
|
|
20
|
-
use
|
|
19
|
+
use temporalio_client::{WfClientExt, WorkflowClientTrait, WorkflowOptions};
|
|
20
|
+
use temporalio_common::{
|
|
21
|
+
Worker,
|
|
22
|
+
errors::PollError,
|
|
23
|
+
protos::{
|
|
24
|
+
DEFAULT_ACTIVITY_TYPE, canned_histories,
|
|
25
|
+
coresdk::{
|
|
26
|
+
ActivityTaskCompletion, AsJsonPayloadExt, FromJsonPayloadExt, IntoPayloadsExt,
|
|
27
|
+
activity_result::ActivityExecutionResult,
|
|
28
|
+
workflow_activation::{WorkflowActivationJob, workflow_activation_job},
|
|
29
|
+
workflow_commands::{
|
|
30
|
+
ActivityCancellationType, ScheduleLocalActivity, workflow_command::Variant,
|
|
31
|
+
},
|
|
32
|
+
workflow_completion,
|
|
33
|
+
workflow_completion::{WorkflowActivationCompletion, workflow_activation_completion},
|
|
34
|
+
},
|
|
35
|
+
temporal::api::{
|
|
36
|
+
command::v1::{RecordMarkerCommandAttributes, command},
|
|
37
|
+
common::v1::RetryPolicy,
|
|
38
|
+
enums::v1::{
|
|
39
|
+
CommandType, EventType, TimeoutType, UpdateWorkflowExecutionLifecycleStage,
|
|
40
|
+
WorkflowTaskFailedCause,
|
|
41
|
+
},
|
|
42
|
+
failure::v1::{Failure, failure::FailureInfo},
|
|
43
|
+
history::v1::history_event::Attributes::MarkerRecordedEventAttributes,
|
|
44
|
+
query::v1::WorkflowQuery,
|
|
45
|
+
update::v1::WaitPolicy,
|
|
46
|
+
},
|
|
47
|
+
test_utils::{query_ok, schedule_local_activity_cmd, start_timer_cmd},
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
use temporalio_sdk::{
|
|
21
51
|
ActContext, ActivityError, ActivityOptions, CancellableFuture, LocalActivityOptions,
|
|
22
52
|
UpdateContext, WfContext, WorkflowFunction, WorkflowResult,
|
|
23
53
|
interceptors::{FailOnNondeterminismInterceptor, WorkerInterceptor},
|
|
24
54
|
};
|
|
25
|
-
use
|
|
55
|
+
use temporalio_sdk_core::{
|
|
26
56
|
prost_dur,
|
|
27
57
|
replay::{DEFAULT_WORKFLOW_TYPE, HistoryForReplay, TestHistoryBuilder, default_wes_attribs},
|
|
28
58
|
test_help::{
|
|
@@ -31,33 +61,6 @@ use temporal_sdk_core::{
|
|
|
31
61
|
single_hist_mock_sg,
|
|
32
62
|
},
|
|
33
63
|
};
|
|
34
|
-
use temporal_sdk_core_api::{Worker, errors::PollError};
|
|
35
|
-
use temporal_sdk_core_protos::{
|
|
36
|
-
DEFAULT_ACTIVITY_TYPE, canned_histories,
|
|
37
|
-
coresdk::{
|
|
38
|
-
ActivityTaskCompletion, AsJsonPayloadExt, FromJsonPayloadExt, IntoPayloadsExt,
|
|
39
|
-
activity_result::ActivityExecutionResult,
|
|
40
|
-
workflow_activation::{WorkflowActivationJob, workflow_activation_job},
|
|
41
|
-
workflow_commands::{
|
|
42
|
-
ActivityCancellationType, ScheduleLocalActivity, workflow_command::Variant,
|
|
43
|
-
},
|
|
44
|
-
workflow_completion,
|
|
45
|
-
workflow_completion::{WorkflowActivationCompletion, workflow_activation_completion},
|
|
46
|
-
},
|
|
47
|
-
temporal::api::{
|
|
48
|
-
command::v1::{RecordMarkerCommandAttributes, command},
|
|
49
|
-
common::v1::RetryPolicy,
|
|
50
|
-
enums::v1::{
|
|
51
|
-
CommandType, EventType, TimeoutType, UpdateWorkflowExecutionLifecycleStage,
|
|
52
|
-
WorkflowTaskFailedCause,
|
|
53
|
-
},
|
|
54
|
-
failure::v1::{Failure, failure::FailureInfo},
|
|
55
|
-
history::v1::history_event::Attributes::MarkerRecordedEventAttributes,
|
|
56
|
-
query::v1::WorkflowQuery,
|
|
57
|
-
update::v1::WaitPolicy,
|
|
58
|
-
},
|
|
59
|
-
test_utils::{query_ok, schedule_local_activity_cmd, start_timer_cmd},
|
|
60
|
-
};
|
|
61
64
|
use tokio::{join, select, sync::Barrier};
|
|
62
65
|
use tokio_util::sync::CancellationToken;
|
|
63
66
|
|
|
@@ -301,7 +304,7 @@ impl WorkerInterceptor for LACancellerInterceptor {
|
|
|
301
304
|
self.token.cancel();
|
|
302
305
|
}
|
|
303
306
|
}
|
|
304
|
-
fn on_shutdown(&self, _: &
|
|
307
|
+
fn on_shutdown(&self, _: &temporalio_sdk::Worker) {
|
|
305
308
|
if !self.cancel_on_workflow_completed {
|
|
306
309
|
self.token.cancel()
|
|
307
310
|
}
|
|
@@ -631,11 +634,10 @@ async fn repro_nondeterminism_with_timer_bug() {
|
|
|
631
634
|
#[rstest::rstest]
|
|
632
635
|
#[tokio::test]
|
|
633
636
|
async fn weird_la_nondeterminism_repro(#[values(true, false)] fix_hist: bool) {
|
|
634
|
-
let mut hist =
|
|
635
|
-
"
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
.unwrap();
|
|
637
|
+
let mut hist =
|
|
638
|
+
history_from_proto_binary("evict_while_la_running_no_interference-85_history.bin")
|
|
639
|
+
.await
|
|
640
|
+
.unwrap();
|
|
639
641
|
if fix_hist {
|
|
640
642
|
// Replace broken ending with accurate ending
|
|
641
643
|
hist.events.truncate(20);
|
|
@@ -659,11 +661,10 @@ async fn weird_la_nondeterminism_repro(#[values(true, false)] fix_hist: bool) {
|
|
|
659
661
|
|
|
660
662
|
#[tokio::test]
|
|
661
663
|
async fn second_weird_la_nondeterminism_repro() {
|
|
662
|
-
let mut hist =
|
|
663
|
-
"
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
.unwrap();
|
|
664
|
+
let mut hist =
|
|
665
|
+
history_from_proto_binary("evict_while_la_running_no_interference-23_history.bin")
|
|
666
|
+
.await
|
|
667
|
+
.unwrap();
|
|
667
668
|
// Chop off uninteresting ending
|
|
668
669
|
hist.events.truncate(24);
|
|
669
670
|
let mut thb = TestHistoryBuilder::from_history(hist.events);
|
|
@@ -684,11 +685,10 @@ async fn second_weird_la_nondeterminism_repro() {
|
|
|
684
685
|
|
|
685
686
|
#[tokio::test]
|
|
686
687
|
async fn third_weird_la_nondeterminism_repro() {
|
|
687
|
-
let mut hist =
|
|
688
|
-
"
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
.unwrap();
|
|
688
|
+
let mut hist =
|
|
689
|
+
history_from_proto_binary("evict_while_la_running_no_interference-16_history.bin")
|
|
690
|
+
.await
|
|
691
|
+
.unwrap();
|
|
692
692
|
let mut thb = TestHistoryBuilder::from_history(hist.events);
|
|
693
693
|
thb.add_workflow_task_scheduled_and_started();
|
|
694
694
|
hist = thb.get_full_history_info().unwrap().into();
|
|
@@ -871,7 +871,7 @@ async fn long_local_activity_with_update(
|
|
|
871
871
|
let replay_worker = init_core_replay_preloaded(
|
|
872
872
|
starter.get_task_queue(),
|
|
873
873
|
[HistoryForReplay::new(
|
|
874
|
-
history_from_proto_binary(&format!("
|
|
874
|
+
history_from_proto_binary(&format!("{wf_name}_history.bin"))
|
|
875
875
|
.await
|
|
876
876
|
.unwrap(),
|
|
877
877
|
"fake".to_owned(),
|
package/sdk-core/{tests → crates/sdk-core/tests}/integ_tests/workflow_tests/modify_wf_properties.rs
RENAMED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
use crate::common::{CoreWfStarter, build_fake_sdk};
|
|
2
|
-
use
|
|
3
|
-
use
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
use temporalio_client::WorkflowClientTrait;
|
|
3
|
+
use temporalio_common::{
|
|
4
|
+
protos::{
|
|
5
|
+
DEFAULT_WORKFLOW_TYPE, TestHistoryBuilder,
|
|
6
|
+
coresdk::{AsJsonPayloadExt, FromJsonPayloadExt},
|
|
7
|
+
temporal::api::{
|
|
8
|
+
command::v1::{Command, command},
|
|
9
|
+
common::v1::Payload,
|
|
10
|
+
enums::v1::EventType,
|
|
11
|
+
},
|
|
12
12
|
},
|
|
13
|
+
worker::WorkerTaskTypes,
|
|
13
14
|
};
|
|
15
|
+
use temporalio_sdk::{WfContext, WorkflowResult};
|
|
16
|
+
use temporalio_sdk_core::test_help::MockPollCfg;
|
|
14
17
|
use uuid::Uuid;
|
|
15
18
|
|
|
16
19
|
static FIELD_A: &str = "cat_name";
|
|
@@ -29,7 +32,9 @@ async fn sends_modify_wf_props() {
|
|
|
29
32
|
let wf_name = "can_upsert_memo";
|
|
30
33
|
let wf_id = Uuid::new_v4();
|
|
31
34
|
let mut starter = CoreWfStarter::new(wf_name);
|
|
32
|
-
starter
|
|
35
|
+
starter
|
|
36
|
+
.worker_config
|
|
37
|
+
.task_types(WorkerTaskTypes::workflow_only());
|
|
33
38
|
let mut worker = starter.worker().await;
|
|
34
39
|
|
|
35
40
|
worker.register_wf(wf_name, memo_upserter);
|
|
@@ -11,28 +11,31 @@ use std::{
|
|
|
11
11
|
},
|
|
12
12
|
time::Duration,
|
|
13
13
|
};
|
|
14
|
-
use
|
|
15
|
-
use
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
use temporalio_client::{WfClientExt, WorkflowClientTrait, WorkflowOptions};
|
|
15
|
+
use temporalio_common::{
|
|
16
|
+
errors::PollError,
|
|
17
|
+
protos::{
|
|
18
|
+
coresdk::{
|
|
19
|
+
FromJsonPayloadExt,
|
|
20
|
+
nexus::{
|
|
21
|
+
NexusOperationCancellationType, NexusOperationResult, NexusTaskCancelReason,
|
|
22
|
+
NexusTaskCompletion, nexus_operation_result, nexus_task, nexus_task_completion,
|
|
23
|
+
},
|
|
23
24
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
temporal::api::{
|
|
26
|
+
common::v1::{Callback, callback},
|
|
27
|
+
enums::v1::NexusHandlerErrorRetryBehavior,
|
|
28
|
+
failure::v1::{Failure, failure::FailureInfo},
|
|
29
|
+
nexus,
|
|
30
|
+
nexus::v1::{
|
|
31
|
+
CancelOperationResponse, HandlerError, StartOperationResponse, request,
|
|
32
|
+
start_operation_response, workflow_event_link_from_nexus,
|
|
33
|
+
},
|
|
33
34
|
},
|
|
34
35
|
},
|
|
36
|
+
worker::WorkerTaskTypes,
|
|
35
37
|
};
|
|
38
|
+
use temporalio_sdk::{CancellableFuture, NexusOperationOptions, WfContext, WfExitValue};
|
|
36
39
|
use tokio::{
|
|
37
40
|
join,
|
|
38
41
|
sync::{mpsc, watch},
|
|
@@ -55,7 +58,12 @@ async fn nexus_basic(
|
|
|
55
58
|
) {
|
|
56
59
|
let wf_name = "nexus_basic";
|
|
57
60
|
let mut starter = CoreWfStarter::new(wf_name);
|
|
58
|
-
starter.worker_config.
|
|
61
|
+
starter.worker_config.task_types(WorkerTaskTypes {
|
|
62
|
+
enable_workflows: true,
|
|
63
|
+
enable_local_activities: false,
|
|
64
|
+
enable_remote_activities: false,
|
|
65
|
+
enable_nexus: true,
|
|
66
|
+
});
|
|
59
67
|
let mut worker = starter.worker().await;
|
|
60
68
|
let core_worker = starter.get_worker().await;
|
|
61
69
|
|
|
@@ -200,7 +208,12 @@ async fn nexus_async(
|
|
|
200
208
|
) {
|
|
201
209
|
let wf_name = "nexus_async";
|
|
202
210
|
let mut starter = CoreWfStarter::new(wf_name);
|
|
203
|
-
starter.worker_config.
|
|
211
|
+
starter.worker_config.task_types(WorkerTaskTypes {
|
|
212
|
+
enable_workflows: true,
|
|
213
|
+
enable_local_activities: false,
|
|
214
|
+
enable_remote_activities: false,
|
|
215
|
+
enable_nexus: true,
|
|
216
|
+
});
|
|
204
217
|
let mut worker = starter.worker().await;
|
|
205
218
|
let core_worker = starter.get_worker().await;
|
|
206
219
|
|
|
@@ -427,7 +440,12 @@ async fn nexus_async(
|
|
|
427
440
|
async fn nexus_cancel_before_start() {
|
|
428
441
|
let wf_name = "nexus_cancel_before_start";
|
|
429
442
|
let mut starter = CoreWfStarter::new(wf_name);
|
|
430
|
-
starter.worker_config.
|
|
443
|
+
starter.worker_config.task_types(WorkerTaskTypes {
|
|
444
|
+
enable_workflows: true,
|
|
445
|
+
enable_local_activities: false,
|
|
446
|
+
enable_remote_activities: false,
|
|
447
|
+
enable_nexus: true,
|
|
448
|
+
});
|
|
431
449
|
let mut worker = starter.worker().await;
|
|
432
450
|
|
|
433
451
|
let endpoint = mk_nexus_endpoint(&mut starter).await;
|
|
@@ -469,7 +487,12 @@ async fn nexus_cancel_before_start() {
|
|
|
469
487
|
async fn nexus_must_complete_task_to_shutdown(#[values(true, false)] use_grace_period: bool) {
|
|
470
488
|
let wf_name = "nexus_must_complete_task_to_shutdown";
|
|
471
489
|
let mut starter = CoreWfStarter::new(wf_name);
|
|
472
|
-
starter.worker_config.
|
|
490
|
+
starter.worker_config.task_types(WorkerTaskTypes {
|
|
491
|
+
enable_workflows: true,
|
|
492
|
+
enable_local_activities: false,
|
|
493
|
+
enable_remote_activities: false,
|
|
494
|
+
enable_nexus: true,
|
|
495
|
+
});
|
|
473
496
|
if use_grace_period {
|
|
474
497
|
starter
|
|
475
498
|
.worker_config
|
|
@@ -569,7 +592,12 @@ async fn nexus_cancellation_types(
|
|
|
569
592
|
) {
|
|
570
593
|
let wf_name = "nexus_cancellation_types";
|
|
571
594
|
let mut starter = CoreWfStarter::new(wf_name);
|
|
572
|
-
starter.worker_config.
|
|
595
|
+
starter.worker_config.task_types(WorkerTaskTypes {
|
|
596
|
+
enable_workflows: true,
|
|
597
|
+
enable_local_activities: false,
|
|
598
|
+
enable_remote_activities: false,
|
|
599
|
+
enable_nexus: true,
|
|
600
|
+
});
|
|
573
601
|
let mut worker = starter.worker().await;
|
|
574
602
|
let core_worker = starter.get_worker().await;
|
|
575
603
|
|
|
@@ -7,10 +7,8 @@ use std::{
|
|
|
7
7
|
},
|
|
8
8
|
time::Duration,
|
|
9
9
|
};
|
|
10
|
-
use
|
|
11
|
-
use
|
|
12
|
-
use temporal_sdk_core::test_help::{CoreInternalFlags, MockPollCfg, ResponseType};
|
|
13
|
-
use temporal_sdk_core_protos::{
|
|
10
|
+
use temporalio_client::WorkflowClientTrait;
|
|
11
|
+
use temporalio_common::protos::{
|
|
14
12
|
DEFAULT_WORKFLOW_TYPE, TestHistoryBuilder, VERSION_SEARCH_ATTR_KEY,
|
|
15
13
|
constants::PATCH_MARKER_NAME,
|
|
16
14
|
coresdk::{
|
|
@@ -31,6 +29,10 @@ use temporal_sdk_core_protos::{
|
|
|
31
29
|
},
|
|
32
30
|
},
|
|
33
31
|
};
|
|
32
|
+
|
|
33
|
+
use temporalio_common::worker::WorkerTaskTypes;
|
|
34
|
+
use temporalio_sdk::{ActivityOptions, WfContext, WorkflowResult};
|
|
35
|
+
use temporalio_sdk_core::test_help::{CoreInternalFlags, MockPollCfg, ResponseType};
|
|
34
36
|
use tokio::{join, sync::Notify};
|
|
35
37
|
use tokio_stream::StreamExt;
|
|
36
38
|
|
|
@@ -55,7 +57,9 @@ pub(crate) async fn changes_wf(ctx: WfContext) -> WorkflowResult<()> {
|
|
|
55
57
|
async fn writes_change_markers() {
|
|
56
58
|
let wf_name = "writes_change_markers";
|
|
57
59
|
let mut starter = CoreWfStarter::new(wf_name);
|
|
58
|
-
starter
|
|
60
|
+
starter
|
|
61
|
+
.worker_config
|
|
62
|
+
.task_types(WorkerTaskTypes::workflow_only());
|
|
59
63
|
let mut worker = starter.worker().await;
|
|
60
64
|
worker.register_wf(wf_name.to_owned(), changes_wf);
|
|
61
65
|
|
|
@@ -89,7 +93,9 @@ pub(crate) async fn no_change_then_change_wf(ctx: WfContext) -> WorkflowResult<(
|
|
|
89
93
|
async fn can_add_change_markers() {
|
|
90
94
|
let wf_name = "can_add_change_markers";
|
|
91
95
|
let mut starter = CoreWfStarter::new(wf_name);
|
|
92
|
-
starter
|
|
96
|
+
starter
|
|
97
|
+
.worker_config
|
|
98
|
+
.task_types(WorkerTaskTypes::workflow_only());
|
|
93
99
|
let mut worker = starter.worker().await;
|
|
94
100
|
worker.register_wf(wf_name.to_owned(), no_change_then_change_wf);
|
|
95
101
|
|
|
@@ -113,7 +119,9 @@ pub(crate) async fn replay_with_change_marker_wf(ctx: WfContext) -> WorkflowResu
|
|
|
113
119
|
async fn replaying_with_patch_marker() {
|
|
114
120
|
let wf_name = "replaying_with_patch_marker";
|
|
115
121
|
let mut starter = CoreWfStarter::new(wf_name);
|
|
116
|
-
starter
|
|
122
|
+
starter
|
|
123
|
+
.worker_config
|
|
124
|
+
.task_types(WorkerTaskTypes::workflow_only());
|
|
117
125
|
let mut worker = starter.worker().await;
|
|
118
126
|
worker.register_wf(wf_name.to_owned(), replay_with_change_marker_wf);
|
|
119
127
|
|
|
@@ -132,7 +140,7 @@ async fn patched_on_second_workflow_task_is_deterministic() {
|
|
|
132
140
|
starter
|
|
133
141
|
.worker_config
|
|
134
142
|
.max_cached_workflows(0_usize)
|
|
135
|
-
.
|
|
143
|
+
.task_types(WorkerTaskTypes::workflow_only());
|
|
136
144
|
let mut worker = starter.worker().await;
|
|
137
145
|
// Include a task failure as well to make sure that works
|
|
138
146
|
static FAIL_ONCE: AtomicBool = AtomicBool::new(true);
|
|
@@ -155,7 +163,9 @@ async fn patched_on_second_workflow_task_is_deterministic() {
|
|
|
155
163
|
async fn can_remove_deprecated_patch_near_other_patch() {
|
|
156
164
|
let wf_name = "can_add_change_markers";
|
|
157
165
|
let mut starter = CoreWfStarter::new(wf_name);
|
|
158
|
-
starter
|
|
166
|
+
starter
|
|
167
|
+
.worker_config
|
|
168
|
+
.task_types(WorkerTaskTypes::workflow_only());
|
|
159
169
|
let mut worker = starter.worker().await;
|
|
160
170
|
let did_die = Arc::new(AtomicBool::new(false));
|
|
161
171
|
worker.register_wf(wf_name.to_owned(), move |ctx: WfContext| {
|
|
@@ -186,7 +196,9 @@ async fn can_remove_deprecated_patch_near_other_patch() {
|
|
|
186
196
|
async fn deprecated_patch_removal() {
|
|
187
197
|
let wf_name = "deprecated_patch_removal";
|
|
188
198
|
let mut starter = CoreWfStarter::new(wf_name);
|
|
189
|
-
starter
|
|
199
|
+
starter
|
|
200
|
+
.worker_config
|
|
201
|
+
.task_types(WorkerTaskTypes::workflow_only());
|
|
190
202
|
let mut worker = starter.worker().await;
|
|
191
203
|
let client = starter.get_client().await;
|
|
192
204
|
let wf_id = starter.get_task_queue().to_string();
|
|
@@ -8,22 +8,24 @@ use crate::{
|
|
|
8
8
|
use assert_matches::assert_matches;
|
|
9
9
|
use parking_lot::Mutex;
|
|
10
10
|
use std::{collections::HashSet, sync::Arc, time::Duration};
|
|
11
|
-
use
|
|
12
|
-
|
|
11
|
+
use temporalio_common::{
|
|
12
|
+
errors::PollError,
|
|
13
|
+
prost_dur,
|
|
14
|
+
protos::{
|
|
15
|
+
DEFAULT_WORKFLOW_TYPE, TestHistoryBuilder, canned_histories,
|
|
16
|
+
coresdk::{
|
|
17
|
+
workflow_activation::remove_from_cache::EvictionReason,
|
|
18
|
+
workflow_commands::{ScheduleActivity, StartTimer},
|
|
19
|
+
workflow_completion::WorkflowActivationCompletion,
|
|
20
|
+
},
|
|
21
|
+
temporal::api::enums::v1::EventType,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
use temporalio_sdk::{WfContext, Worker, WorkflowFunction, interceptors::WorkerInterceptor};
|
|
25
|
+
use temporalio_sdk_core::{
|
|
13
26
|
replay::{HistoryFeeder, HistoryForReplay},
|
|
14
27
|
test_help::{MockPollCfg, ResponseType, WorkerTestHelpers},
|
|
15
28
|
};
|
|
16
|
-
use temporal_sdk_core_api::errors::PollError;
|
|
17
|
-
use temporal_sdk_core_protos::{
|
|
18
|
-
DEFAULT_WORKFLOW_TYPE, TestHistoryBuilder, canned_histories,
|
|
19
|
-
coresdk::{
|
|
20
|
-
workflow_activation::remove_from_cache::EvictionReason,
|
|
21
|
-
workflow_commands::{ScheduleActivity, StartTimer},
|
|
22
|
-
workflow_completion::WorkflowActivationCompletion,
|
|
23
|
-
},
|
|
24
|
-
prost_dur,
|
|
25
|
-
temporal::api::enums::v1::EventType,
|
|
26
|
-
};
|
|
27
29
|
use tokio::join;
|
|
28
30
|
|
|
29
31
|
fn test_hist_to_replay(t: TestHistoryBuilder) -> HistoryForReplay {
|
|
@@ -88,7 +90,7 @@ async fn timer_workflow_replay() {
|
|
|
88
90
|
let core = init_core_replay_preloaded(
|
|
89
91
|
"timer_workflow_replay",
|
|
90
92
|
[HistoryForReplay::new(
|
|
91
|
-
history_from_proto_binary("
|
|
93
|
+
history_from_proto_binary("timer_workflow_history.bin")
|
|
92
94
|
.await
|
|
93
95
|
.unwrap(),
|
|
94
96
|
"fake".to_owned(),
|
|
@@ -145,7 +147,7 @@ async fn workflow_nondeterministic_replay() {
|
|
|
145
147
|
let core = init_core_replay_preloaded(
|
|
146
148
|
"timer_workflow_replay",
|
|
147
149
|
[HistoryForReplay::new(
|
|
148
|
-
history_from_proto_binary("
|
|
150
|
+
history_from_proto_binary("timer_workflow_history.bin")
|
|
149
151
|
.await
|
|
150
152
|
.unwrap(),
|
|
151
153
|
"fake".to_owned(),
|
|
@@ -300,7 +302,7 @@ async fn multiple_histories_can_handle_dupe_run_ids() {
|
|
|
300
302
|
#[tokio::test]
|
|
301
303
|
async fn replay_old_patch_format() {
|
|
302
304
|
let mut worker = replay_sdk_worker([HistoryForReplay::new(
|
|
303
|
-
history_from_proto_binary("
|
|
305
|
+
history_from_proto_binary("old_change_marker_format.bin")
|
|
304
306
|
.await
|
|
305
307
|
.unwrap(),
|
|
306
308
|
"fake".to_owned(),
|
|
@@ -314,7 +316,7 @@ async fn replay_ends_with_empty_wft() {
|
|
|
314
316
|
let core = init_core_replay_preloaded(
|
|
315
317
|
"SayHelloWorkflow",
|
|
316
318
|
[HistoryForReplay::new(
|
|
317
|
-
history_from_proto_binary("
|
|
319
|
+
history_from_proto_binary("ends_empty_wft_complete.bin")
|
|
318
320
|
.await
|
|
319
321
|
.unwrap(),
|
|
320
322
|
"fake".to_owned(),
|
|
@@ -10,14 +10,16 @@ use std::{
|
|
|
10
10
|
},
|
|
11
11
|
time::Duration,
|
|
12
12
|
};
|
|
13
|
-
use
|
|
14
|
-
use
|
|
15
|
-
use temporal_sdk_core_protos::{
|
|
13
|
+
use temporalio_client::{WfClientExt, WorkflowClientTrait, WorkflowOptions, WorkflowService};
|
|
14
|
+
use temporalio_common::protos::{
|
|
16
15
|
coresdk::AsJsonPayloadExt,
|
|
17
16
|
temporal::api::{
|
|
18
17
|
common::v1::WorkflowExecution, workflowservice::v1::ResetWorkflowExecutionRequest,
|
|
19
18
|
},
|
|
20
19
|
};
|
|
20
|
+
|
|
21
|
+
use temporalio_common::worker::WorkerTaskTypes;
|
|
22
|
+
use temporalio_sdk::{LocalActivityOptions, WfContext};
|
|
21
23
|
use tokio::sync::Notify;
|
|
22
24
|
use tonic::IntoRequest;
|
|
23
25
|
|
|
@@ -27,7 +29,9 @@ const POST_RESET_SIG: &str = "post-reset";
|
|
|
27
29
|
async fn reset_workflow() {
|
|
28
30
|
let wf_name = "reset_me_wf";
|
|
29
31
|
let mut starter = CoreWfStarter::new(wf_name);
|
|
30
|
-
starter
|
|
32
|
+
starter
|
|
33
|
+
.worker_config
|
|
34
|
+
.task_types(WorkerTaskTypes::workflow_only());
|
|
31
35
|
let mut worker = starter.worker().await;
|
|
32
36
|
worker.fetch_results = false;
|
|
33
37
|
let notify = Arc::new(Notify::new());
|
|
@@ -113,7 +117,12 @@ async fn reset_workflow() {
|
|
|
113
117
|
async fn reset_randomseed() {
|
|
114
118
|
let wf_name = "reset_randomseed";
|
|
115
119
|
let mut starter = CoreWfStarter::new(wf_name);
|
|
116
|
-
starter.worker_config.
|
|
120
|
+
starter.worker_config.task_types(WorkerTaskTypes {
|
|
121
|
+
enable_workflows: true,
|
|
122
|
+
enable_local_activities: true,
|
|
123
|
+
enable_remote_activities: false,
|
|
124
|
+
enable_nexus: true,
|
|
125
|
+
});
|
|
117
126
|
let mut worker = starter.worker().await;
|
|
118
127
|
worker.fetch_results = false;
|
|
119
128
|
let notify = Arc::new(Notify::new());
|