Switched the directory observer in QueueReader from inotify to polling,

in order to properly handle NFS-mounted queue directories.

As a consequence, the default timeout for awaiting job results in the tests
was upped to 10 seconds due to the slightly slower queue pickup.
This commit is contained in:
Erik Thuning 2023-12-08 11:32:16 +01:00
parent 60150c98ab
commit a5d9eef356
2 changed files with 4 additions and 3 deletions

@ -6,7 +6,7 @@ import re
from pathlib import Path
from watchdog.events import FileSystemEventHandler
from watchdog.observers import Observer
from watchdog.observers.polling import PollingObserver
from .notifier import ErrorNote
@ -16,7 +16,7 @@ class QueueReader(FileSystemEventHandler):
self.preprocessors = preprocessors
self.notifier = notifier
self.queuedir = queuedir
self.watcher = Observer()
self.watcher = PollingObserver()
self.watcher.schedule(self, queuedir)
# The following regex matches a UUID:
# A string consisting of hexadecimal characters split by dashes

@ -38,6 +38,7 @@ def dummyjob(name, wait):
return name
#@unittest.skip
class WorkThreadTest(unittest.TestCase):
def setUp(self):
self.worker = WorkThread(20)
@ -242,7 +243,7 @@ class PipelineTest(DaemonTest):
json.dump(queuedata, f)
return jobid
def wait_for_result(self, jobid, handlers, timeout=5):
def wait_for_result(self, jobid, handlers, timeout=10):
resultfiles = {}
final_result = None
for handler in handlers: