Sometimes this test was timing out due to the file monitor notifications
taking longer than the arbitrary 2s delay before ending the test and
checking its results at the end of
Avoid that timing-dependence by ending the test when the expected file monitor notifications are seen, or after a 10s timeout (if so, the test is failed).
This makes the test run 4× faster in the normal case, as it’s no longer waiting for a timeout to elapse if the file monitor notifications come in sooner.
Signed-off-by: Philip Withnall email@example.com