Skip to content

Commit 7783c83

Browse files
committed
PR Feedback
1 parent d736426 commit 7783c83

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

durabletask/testing/in_memory_backend.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ def stop(self, grace: Optional[float] = None):
160160
self._shutdown_event.set()
161161
self._work_available.set() # Unblock GetWorkItems loops
162162
if self._server:
163-
self._server.stop(grace)
163+
stop_future = self._server.stop(grace)
164+
stop_future.wait()
165+
self._server = None
164166
self._logger.info("In-memory backend stopped")
165167

166168
def reset(self):
@@ -621,6 +623,8 @@ def CompleteEntityTask(self, request: pb.EntityBatchResult, context):
621623
# Update entity state
622624
if request.entityState and request.entityState.value:
623625
entity.serialized_state = request.entityState.value
626+
else:
627+
entity.serialized_state = None
624628
entity.last_modified_at = datetime.now(timezone.utc)
625629

626630
# Update completion token for next batch
@@ -1472,7 +1476,8 @@ def create_test_backend(port: int = 50051, max_history_size: int = 10000) -> InM
14721476
```python
14731477
import pytest
14741478
from durabletask.testing.in_memory_backend import create_test_backend
1475-
from durabletask import TaskHubGrpcClient, TaskHubGrpcWorker
1479+
from durabletask.client import TaskHubGrpcClient
1480+
from durabletask.worker import TaskHubGrpcWorker
14761481
14771482
@pytest.fixture
14781483
def backend():

tests/durabletask/entities/test_class_based_entities_e2e.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
from durabletask import client, entities, task, worker
1313
from durabletask.testing import create_test_backend
1414

15-
HOST = "localhost:50055"
15+
HOST = "localhost:50059"
1616

1717

1818
@pytest.fixture(autouse=True)
1919
def backend():
2020
"""Create an in-memory backend for entity testing."""
21-
b = create_test_backend(port=50055)
21+
b = create_test_backend(port=50059)
2222
yield b
2323
b.stop()
2424
b.reset()

tests/durabletask/test_orchestration_versioning_e2e.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# Licensed under the MIT License.
33

44
import json
5-
import warnings
65

76
import pytest
87

@@ -22,9 +21,6 @@ def backend():
2221

2322

2423
def test_versioned_orchestration_succeeds():
25-
warnings.warn("Skipping test_versioned_orchestration_succeeds. "
26-
"Currently not passing as the in-memory backend does not support versioning yet")
27-
2824
def plus_one(_: task.ActivityContext, input: int) -> int:
2925
return input + 1
3026

0 commit comments

Comments
 (0)