Skip to content

Commit d6775f7

Browse files
committed
non-dts test fix
1 parent ae20682 commit d6775f7

File tree

1 file changed

+9
-63
lines changed

1 file changed

+9
-63
lines changed

tests/durabletask/test_batch_actions.py

Lines changed: 9 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_get_all_entities():
4242
c = client.TaskHubGrpcClient()
4343
with pytest.raises(_InactiveRpcError) as exec_info:
4444
c.get_all_entities()
45-
assert "unimplemented" in str(exec_info.value)
45+
assert "method QueryEntities not implemented" in str(exec_info.value)
4646

4747

4848
def test_clean_entity_storage():
@@ -54,7 +54,7 @@ def test_clean_entity_storage():
5454
c = client.TaskHubGrpcClient()
5555
with pytest.raises(_InactiveRpcError) as exec_info:
5656
c.clean_entity_storage()
57-
assert "unimplemented" in str(exec_info.value)
57+
assert "method CleanEntityStorage not implemented" in str(exec_info.value)
5858

5959

6060
def test_purge_orchestrations_by_status():
@@ -63,64 +63,10 @@ def test_purge_orchestrations_by_status():
6363
w.start()
6464

6565
c = client.TaskHubGrpcClient()
66-
67-
# Schedule and let it fail
68-
failed_id = c.schedule_new_orchestration(failing_orchestrator)
69-
try:
70-
c.wait_for_orchestration_completion(failed_id, timeout=30)
71-
except client.OrchestrationFailedError:
72-
pass # Expected failure
73-
74-
# Verify it exists and is failed
75-
state_before = c.get_orchestration_state(failed_id)
76-
assert state_before is not None
77-
assert state_before.runtime_status == client.OrchestrationStatus.FAILED
78-
79-
# Purge failed orchestrations
80-
result = c.purge_orchestrations_by(
81-
runtime_status=[client.OrchestrationStatus.FAILED],
82-
recursive=True
83-
)
84-
85-
# Verify purge result
86-
assert result.deleted_instance_count >= 1
87-
88-
# Verify the failed orchestration no longer exists
89-
state_after = c.get_orchestration_state(failed_id)
90-
assert state_after is None
91-
92-
93-
def test_purge_orchestrations_by_time_range():
94-
with worker.TaskHubGrpcWorker() as w:
95-
w.add_orchestrator(empty_orchestrator)
96-
w.start()
97-
98-
c = client.TaskHubGrpcClient()
99-
100-
# Get current time
101-
before_creation = datetime.now(timezone.utc) - timedelta(seconds=5)
102-
103-
# Schedule orchestration
104-
id = c.schedule_new_orchestration(empty_orchestrator, input="ToPurgeByTime")
105-
c.wait_for_orchestration_completion(id, timeout=30)
106-
107-
after_creation = datetime.now(timezone.utc) + timedelta(seconds=5)
108-
109-
# Verify it exists
110-
state_before = c.get_orchestration_state(id)
111-
assert state_before is not None
112-
113-
# Purge by time range
114-
result = c.purge_orchestrations_by(
115-
created_time_from=before_creation,
116-
created_time_to=after_creation,
117-
runtime_status=[client.OrchestrationStatus.COMPLETED],
118-
recursive=True
119-
)
120-
121-
# Verify purge result
122-
assert result.deleted_instance_count >= 1
123-
124-
# Verify it no longer exists
125-
state_after = c.get_orchestration_state(id)
126-
assert state_after is None
66+
with pytest.raises(_InactiveRpcError) as exec_info:
67+
c.purge_orchestrations_by(
68+
runtime_status=[client.OrchestrationStatus.FAILED],
69+
recursive=True
70+
)
71+
# sic - error returned from sidecar
72+
assert "multi-instance purge is not unimplemented" in str(exec_info.value)

0 commit comments

Comments
 (0)