mirror of
https://github.com/open-webui/tests.git
synced 2026-11-05 01:37:32 +00:00
[PR #8] [CLOSED] test: add source-audit tests for the async DoclingLoader rework #10
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/tests#10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/tests/pull/8
Author: @jannefleischer
Created: 7/9/2026
Status: ❌ Closed
Base:
main← Head:feat-docling-loader-async📝 Commits (1)
26e12d3test: add source-audit tests for the async DoclingLoader rework📊 Changes
1 file changed (+842 additions, -0 deletions)
View changed files
➕
unit/retrieval/test_docling_loader_async.py(+842 -0)📄 Description
THIS IS MOSTLY DONE BY AI. I am an urban planner having (almost) no understanding of the inner workings of tests...
This relies on PR https://github.com/open-webui/open-webui/pull/26947 (which is part of discussion in https://github.com/open-webui/open-webui/discussions/26931)
Covers the DoclingLoader rework that replaces the old blocking
/v1/convert/filecall with submit (/v1/convert/file/async) -> long-poll (/v1/status/poll/{task_id}) -> retrieve (/v1/result/{task_id}), on both its sync (load()) and true async (aload()) paths, plus:DOCLING_SERVE_TIMEOUT), wired end-to-end fromconfig.pythroughLOADER_CONFIG_KEYS/RETRIEVAL_CONFIG_KEYS,ConfigForm, andupdate_rag_configstatus_callbackhook invoked on submit and ontask_positionupdates while polling, on both pathsload_from_task_id()/aload_from_task_id()to resume an already-submitted task without re-uploading_notify_status_async(): the async path awaitsstatus_callback's return value if it's awaitable, since a real caller may reasonably supply anasync defcallback (e.g. one that awaits a DB write) — calling it as a plain function would silently produce an un-awaited coroutine that never runsLoader.aload()'s dispatch now routesDoclingLoaderthrough its true asyncaload()directly instead ofasyncio.to_thread(self.load, ...), so a slow conversion no longer occupies a worker thread from the shared default executor for its entire duration; every other loader is unaffected and still goes throughasyncio.to_threadSource-level tests (regex-match the actual backend source via the
open_webui_backendfixture) rather than importingopen_webui.retrieval.loaders.maindirectly, since that module pulls in a dependency tree (typer, langchain_community, azure.identity, ftfy) not present in this repo's test environment — same approach already used for the knowledge-status tests.One thing worth calling out for review: method-boundary lookaheads in this file use
\n (?:async\s+)?def\s+\w+rather than\n def\s+\w+.DoclingLoaderinterleaves sync and async methods, and a lookahead recognizing only plaindefruns straight past anasync defboundary, sweeping a later method's body into the match — I caught this via a false-positive failure on theload_from_task_idtest itself once the async methods were added after it in the source.Verified: all 37 tests pass against the
feat-docling-loader-asyncsource branch, and all 37 correctly fail against the pristine, pre-reworkdevsource — confirmed by pointingOPEN_WEBUI_SOURCE_DIRat each in turn, so these are discriminating regression guards rather than tautologies, not just "assert True".ruff format/ruff check(line length 100, per this repo'spyproject.toml) are clean.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.