Allow configurable timeout for tests
Support polling when inotify on the dir fails