diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6289dbcd0..282823b22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,6 +76,48 @@ jobs: - run: poe lint - run: poe build-develop - run: mkdir junit-xml + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 + - run: poe test ${{matrix.pytestExtraArgs}} -k "test_custom_slot_supplier" -sv --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml + timeout-minutes: 5 - run: poe test ${{matrix.pytestExtraArgs}} -s --junit-xml=junit-xml/${{ matrix.python }}--${{ matrix.os }}.xml timeout-minutes: 15 # Time skipping doesn't yet support ARM diff --git a/temporalio/bridge/Cargo.lock b/temporalio/bridge/Cargo.lock index 740f9a547..bf65c5e54 100644 --- a/temporalio/bridge/Cargo.lock +++ b/temporalio/bridge/Cargo.lock @@ -2075,6 +2075,7 @@ checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustfsm" version = "0.1.0" +source = "git+https://github.com/temporalio/sdk-core?branch=debug_slot_supplier#5b415d997dd5c6cef40f6dd319eda768c2f80ad5" dependencies = [ "rustfsm_procmacro", "rustfsm_trait", @@ -2083,6 +2084,7 @@ dependencies = [ [[package]] name = "rustfsm_procmacro" version = "0.1.0" +source = "git+https://github.com/temporalio/sdk-core?branch=debug_slot_supplier#5b415d997dd5c6cef40f6dd319eda768c2f80ad5" dependencies = [ "derive_more", "proc-macro2", @@ -2094,6 +2096,7 @@ dependencies = [ [[package]] name = "rustfsm_trait" version = "0.1.0" +source = "git+https://github.com/temporalio/sdk-core?branch=debug_slot_supplier#5b415d997dd5c6cef40f6dd319eda768c2f80ad5" [[package]] name = "rustix" @@ -2441,6 +2444,7 @@ dependencies = [ [[package]] name = "temporal-client" version = "0.1.0" +source = "git+https://github.com/temporalio/sdk-core?branch=debug_slot_supplier#5b415d997dd5c6cef40f6dd319eda768c2f80ad5" dependencies = [ "anyhow", "async-trait", @@ -2493,6 +2497,7 @@ dependencies = [ [[package]] name = "temporal-sdk-core" version = "0.1.0" +source = "git+https://github.com/temporalio/sdk-core?branch=debug_slot_supplier#5b415d997dd5c6cef40f6dd319eda768c2f80ad5" dependencies = [ "anyhow", "async-trait", @@ -2552,6 +2557,7 @@ dependencies = [ [[package]] name = "temporal-sdk-core-api" version = "0.1.0" +source = "git+https://github.com/temporalio/sdk-core?branch=debug_slot_supplier#5b415d997dd5c6cef40f6dd319eda768c2f80ad5" dependencies = [ "async-trait", "derive_builder", @@ -2573,6 +2579,7 @@ dependencies = [ [[package]] name = "temporal-sdk-core-protos" version = "0.1.0" +source = "git+https://github.com/temporalio/sdk-core?branch=debug_slot_supplier#5b415d997dd5c6cef40f6dd319eda768c2f80ad5" dependencies = [ "anyhow", "base64", diff --git a/temporalio/bridge/Cargo.toml b/temporalio/bridge/Cargo.toml index 70a3c5820..aa946f051 100644 --- a/temporalio/bridge/Cargo.toml +++ b/temporalio/bridge/Cargo.toml @@ -27,14 +27,14 @@ pyo3 = { version = "0.25", features = [ ] } pyo3-async-runtimes = { version = "0.25", features = ["tokio-runtime"] } pythonize = "0.25" -temporal-client = { version = "0.1.0", path = "./sdk-core/client" } -temporal-sdk-core = { version = "0.1.0", path = "./sdk-core/core", features = [ +temporal-client = { git = "https://github.com/temporalio/sdk-core", branch = "debug_slot_supplier" } +temporal-sdk-core = { git = "https://github.com/temporalio/sdk-core", branch = "debug_slot_supplier", features = [ "ephemeral-server", ] } -temporal-sdk-core-api = { version = "0.1.0", path = "./sdk-core/core-api", features = [ +temporal-sdk-core-api = { git = "https://github.com/temporalio/sdk-core", branch = "debug_slot_supplier", features = [ "envconfig", ] } -temporal-sdk-core-protos = { version = "0.1.0", path = "./sdk-core/sdk-core-protos" } +temporal-sdk-core-protos = { git = "https://github.com/temporalio/sdk-core", branch = "debug_slot_supplier" } tokio = "1.26" tokio-stream = "0.1" tonic = "0.13" diff --git a/temporalio/bridge/sdk-core b/temporalio/bridge/sdk-core index 4078190b9..682d441dd 160000 --- a/temporalio/bridge/sdk-core +++ b/temporalio/bridge/sdk-core @@ -1 +1 @@ -Subproject commit 4078190b99ef16691512bc58e1da2d109419bc93 +Subproject commit 682d441dd3b830e1477af3edb7c2330b403c4c33 diff --git a/temporalio/runtime.py b/temporalio/runtime.py index 84b683941..6e343c227 100644 --- a/temporalio/runtime.py +++ b/temporalio/runtime.py @@ -142,7 +142,7 @@ def _to_bridge_config(self) -> temporalio.bridge.runtime.LoggingConfig: LoggingConfig.default = LoggingConfig( - filter=TelemetryFilter(core_level="WARN", other_level="ERROR") + filter=TelemetryFilter(core_level="DEBUG", other_level="ERROR") ) _module_start_time = time.time() diff --git a/tests/worker/test_worker.py b/tests/worker/test_worker.py index e19325835..345b1a980 100644 --- a/tests/worker/test_worker.py +++ b/tests/worker/test_worker.py @@ -2,6 +2,7 @@ import asyncio import concurrent.futures +import logging import uuid from datetime import timedelta from typing import Any, Awaitable, Callable, Optional, Sequence @@ -64,6 +65,8 @@ with workflow.unsafe.imports_passed_through(): import pytest +logger = logging.getLogger(__name__) + def test_load_default_worker_binary_id(): # Just run it twice and confirm it didn't change @@ -469,6 +472,12 @@ async def reserve_slot(self, ctx: SlotReserveContext) -> SlotPermit: # Verify an async call doesn't bungle things await asyncio.sleep(0.01) self.reserves += 1 + logger.info( + "Reserve slot %d - %s - %s", + self.reserves, + ctx.slot_type, + ctx.task_queue, + ) return MyPermit(self.reserves) def try_reserve_slot(self, ctx: SlotReserveContext) -> Optional[SlotPermit]: @@ -494,6 +503,12 @@ def release_slot(self, ctx: SlotReleaseContext) -> None: assert ctx.permit is not None assert isinstance(ctx.permit, MyPermit) assert ctx.permit.pnum is not None + + logger.info( + "Release slot %d, %d", + ctx.permit.pnum, + self.highest_seen_reserve_on_release, + ) self.highest_seen_reserve_on_release = max( ctx.permit.pnum, self.highest_seen_reserve_on_release )