Skip to content

Commit dead909

Browse files
fix: skip list_tasks integration tests on servers without the endpoint
The /v1/tasks REST endpoint landed on weaviate-core's stable/v1.37 branch on 2026-06-29, but this suite's CI-pinned Docker images for several matrix entries predate that merge and still respond 501 "not yet implemented". Skip rather than fail when that specific status code comes back, so the test stays meaningful once the pinned images catch up.
1 parent 6ee6ba9 commit dead909

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

integration/test_client_debug.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
)
99
from weaviate.classes.config import DataType, Property
1010
from weaviate.classes.debug import DebugRESTObject
11+
from weaviate.exceptions import UnexpectedStatusCodeError
12+
13+
# The /v1/tasks REST endpoint landed on weaviate-core's stable/v1.37 branch on 2026-06-29
14+
# but isn't in every Docker image this suite's version matrix pins yet, so older builds
15+
# still respond 501 "not yet implemented" rather than a real payload.
16+
_DISTRIBUTED_TASKS_NOT_IMPLEMENTED = 501
1117

1218

1319
def test_get_object_single_node(
@@ -68,7 +74,12 @@ def test_get_object_multi_node(
6874
def test_list_tasks(client_factory: ClientFactory) -> None:
6975
client = client_factory()
7076

71-
tasks = client.debug.list_tasks()
77+
try:
78+
tasks = client.debug.list_tasks()
79+
except UnexpectedStatusCodeError as e:
80+
if e.status_code == _DISTRIBUTED_TASKS_NOT_IMPLEMENTED:
81+
pytest.skip("distributed tasks endpoint not yet implemented on this server build")
82+
raise
7283

7384
assert isinstance(tasks, dict)
7485

@@ -77,6 +88,11 @@ def test_list_tasks(client_factory: ClientFactory) -> None:
7788
async def test_list_tasks_async(async_client_factory: AsyncClientFactory) -> None:
7889
client = await async_client_factory()
7990

80-
tasks = await client.debug.list_tasks()
91+
try:
92+
tasks = await client.debug.list_tasks()
93+
except UnexpectedStatusCodeError as e:
94+
if e.status_code == _DISTRIBUTED_TASKS_NOT_IMPLEMENTED:
95+
pytest.skip("distributed tasks endpoint not yet implemented on this server build")
96+
raise
8197

8298
assert isinstance(tasks, dict)

0 commit comments

Comments
 (0)