spring-boot/spring-boot-project/spring-boot-devtools
Andy Wilkinson 2238b0d797 Try to make FileSystemWatcherTests.waitsForQuietPeriod() more robust
Previously, waitsForQuietPeriod would iterate 10 times, touching a new
file and then sleeping for 100ms at it did so. With a quiet period of
200ms, this was intended to result in a single change set containing
10 files. However, the test would fail occasionally as multiple change
sets were detected. The test is multi-threaded and is, therefore, at
the mercy of the scheduler. If the thread that is iterating and
touching the files takes over 200ms to be scheduled – exceeding the
watcher's quiet period – the watcher may detect a change set while the
changes are still being made. Eliminating this possibilty would require
the test to participate in the watcher's synchronization, which would
require some changes to its implementation. Instead, this commit
aims to avoid the problem by sleeping for 1/10 of the time (10ms) and
expecting a single change set of 100 files. The hope is that the much
shorter sleep time will result in the file touching thread being
scheduled well within the 200ms quiet period.

Closes gh-22732
2020-08-05 09:00:49 +01:00
..
src Try to make FileSystemWatcherTests.waitsForQuietPeriod() more robust 2020-08-05 09:00:49 +01:00
pom.xml Fix loading of devtools yaml files 2019-11-20 17:30:26 -08:00