MCPcopy Create free account
hub / github.com/docling-project/docling-parse / test_threaded_backpressure

Function test_threaded_backpressure

tests/test_threaded_parse.py:271–287  ·  view source on GitHub ↗

Test that backpressure works with max_concurrent_results=1.

()

Source from the content-addressed store, hash-verified

269
270
271def test_threaded_backpressure():
272 """Test that backpressure works with max_concurrent_results=1."""
273 filename = LARGE_SAMPLE_PDF
274
275 parser = DoclingThreadedPdfParser(
276 parser_config=ThreadedPdfParserConfig(
277 loglevel="fatal",
278 threads=2,
279 max_concurrent_results=1,
280 boundary_type=PdfPageBoundaryType.CROP_BOX,
281 ),
282 decode_config=_make_decode_config(),
283 )
284
285 key = parser.load(filename)
286 count = sum(1 for result in parser.iterate_results() if result.success)
287 assert count == parser.page_count(key)
288
289
290def test_threaded_single_thread():

Callers

nothing calls this directly

Calls 6

loadMethod · 0.95
iterate_resultsMethod · 0.95
page_countMethod · 0.95
_make_decode_configFunction · 0.70

Tested by

no test coverage detected