mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-01-12 21:44:21 -06:00
Adjusts timing to hopefully work
This commit is contained in:
@@ -655,8 +655,6 @@ class ConsumerThread(Thread):
|
|||||||
self.exception = e
|
self.exception = e
|
||||||
finally:
|
finally:
|
||||||
# Close database connections created in this thread
|
# Close database connections created in this thread
|
||||||
# Important: Do not perform any database operations here (like Tag cleanup)
|
|
||||||
# as they create new connections that won't be properly closed
|
|
||||||
db.connections.close_all()
|
db.connections.close_all()
|
||||||
|
|
||||||
def stop(self) -> None:
|
def stop(self) -> None:
|
||||||
@@ -841,12 +839,15 @@ class TestCommandWatchPolling:
|
|||||||
start_consumer: Callable[..., ConsumerThread],
|
start_consumer: Callable[..., ConsumerThread],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test polling mode detects files."""
|
"""Test polling mode detects files."""
|
||||||
thread = start_consumer(polling_interval=0.5)
|
# Use shorter polling interval for faster test
|
||||||
|
thread = start_consumer(polling_interval=0.5, stability_delay=0.1)
|
||||||
|
|
||||||
target = consumption_dir / "document.pdf"
|
target = consumption_dir / "document.pdf"
|
||||||
shutil.copy(sample_pdf, target)
|
shutil.copy(sample_pdf, target)
|
||||||
|
|
||||||
sleep(1.5)
|
# Wait for: poll interval + stability delay + another poll + margin
|
||||||
|
# CI can be slow, so use generous timeout
|
||||||
|
sleep(2.0)
|
||||||
|
|
||||||
if thread.exception:
|
if thread.exception:
|
||||||
raise thread.exception
|
raise thread.exception
|
||||||
|
|||||||
Reference in New Issue
Block a user