• Andy Wilkinson's avatar
    Make FileSystemWatcherTests.waitsForPollingInterval more robust · 69320180
    Andy Wilkinson authored
    The intent of the test is to:
    
    1. Make a change
    2. Sleep for long enough for that change to be picked up
    3. Make another change
    4. Stop that watcher after 1 further scan has been performed
    5. Assert that a further scan was performed by checking that two
       separate sets of changes (step 1 and step 3) have been picked up
    
    Previously, step 2 relied on simply sleeping for a period of time
    longer than the polling interval. In reality, the polling interval
    is only a minimum time between scans and the actual time between them
    depends on thread scheduling, GC pauses, etc. This lead to the
    test failing intermittently if the scan didn't happen in a timely
    manner.
    
    This commit removes the sleep and replaces it with a while loop that
    waits for first change to be picked up. This ensures that the second
    change will be detected separately from the first and that two
    separate change sets should always be available once the watcher has
    stopped.
    
    See gh-7782
    69320180
Name
Last commit
Last update
.github Loading commit data...
.mvn Loading commit data...
eclipse Loading commit data...
spring-boot Loading commit data...
spring-boot-actuator Loading commit data...
spring-boot-actuator-docs Loading commit data...
spring-boot-autoconfigure Loading commit data...
spring-boot-cli Loading commit data...
spring-boot-dependencies Loading commit data...
spring-boot-deployment-tests Loading commit data...
spring-boot-devtools Loading commit data...
spring-boot-docs Loading commit data...
spring-boot-full-build Loading commit data...
spring-boot-integration-tests Loading commit data...
spring-boot-parent Loading commit data...
spring-boot-samples Loading commit data...
spring-boot-starters Loading commit data...
spring-boot-test Loading commit data...
spring-boot-test-autoconfigure Loading commit data...
spring-boot-tools Loading commit data...
.gitignore Loading commit data...
.settings-template.xml Loading commit data...
.travis.yml Loading commit data...
CODE_OF_CONDUCT.adoc Loading commit data...
CONTRIBUTING.adoc Loading commit data...
LICENSE.txt Loading commit data...
README.adoc Loading commit data...
mvnw Loading commit data...
mvnw.cmd Loading commit data...
pom.xml Loading commit data...