Test that backpressure works with max_concurrent_results=1.
()
| 269 | |
| 270 | |
| 271 | def 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 | |
| 290 | def test_threaded_single_thread(): |
nothing calls this directly
no test coverage detected