by removing the sleep() calls and reducing timeout time, tests remain
as accurate while taking less than 5% of the required time to run
I remember that there was a potential race condition between when a file is created and when a monitor is added and that is why we had this usleep. Basically, the file could some time popup in the monitor even if it was clearly created before. Did you see that problem or is it gone ? I would blame the kernel for such a behavior, but well, it impacts our tests.
I ran the updated tests hundreds of times. I ran them with forking enabled and disabled. I ran them under extreme cpu load and under no load. The tests succeeded in every case excepting the issues listed in T6915.
At no point could this be an issue since I added a check to ignore events on the directory which is created before starting the main loop. I don't know whether such events are received but it's irrelevant even if they are.