docs: clarify postgres-mode None + test exact=True default (review #850)
- Note at both metrics-task call sites that receive_stream is None in postgres mode (get_ingest_pending falls back to procrastinate counts). - Add test_default_is_exact_true covering the status-endpoint count path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
fc3e0f28f6
commit
8c9f97d6c4
@@ -1748,6 +1748,8 @@ def get_app(transport: str = "streamable-http", enabled_apps: list[str] | None =
|
||||
# Publish outstanding-work + corpus gauges on a fixed cadence,
|
||||
# independent of the consumer path and queue backend (fixes the
|
||||
# gauge reading 0 on the multi-user path; see metrics_publisher).
|
||||
# receive_stream is None in postgres mode — get_ingest_pending
|
||||
# falls back to the procrastinate job counts there.
|
||||
await tg.start(
|
||||
vector_sync_metrics_task,
|
||||
task_producer,
|
||||
@@ -1989,6 +1991,8 @@ def get_app(transport: str = "streamable-http", enabled_apps: list[str] | None =
|
||||
# oauth_processor_task, which never updated the queue gauge,
|
||||
# so without this the gauge read 0 while the buffer held
|
||||
# thousands of pending docs (see metrics_publisher).
|
||||
# receive_stream is None in postgres mode — get_ingest_pending
|
||||
# falls back to the procrastinate job counts there.
|
||||
await tg.start(
|
||||
vector_sync_metrics_task,
|
||||
task_producer,
|
||||
|
||||
@@ -78,6 +78,15 @@ class TestCountIndexed:
|
||||
|
||||
assert all(call.kwargs["exact"] is False for call in qc.count.await_args_list)
|
||||
|
||||
async def test_default_is_exact_true(self) -> None:
|
||||
# The on-demand status endpoint relies on the exact=True default.
|
||||
qc = AsyncMock()
|
||||
qc.count.side_effect = [_count_obj(10), _count_obj(3)]
|
||||
|
||||
await mp.count_indexed(qc, _COLLECTION)
|
||||
|
||||
assert all(call.kwargs["exact"] is True for call in qc.count.await_args_list)
|
||||
|
||||
|
||||
class TestPublishVectorSyncMetrics:
|
||||
@pytest.fixture(autouse=True)
|
||||
|
||||
Vendored
+1
-1
Submodule third_party/astrolabe updated: 8a26b8d9bf...54adb28f1d
Reference in New Issue
Block a user