bugfix: should increment loopcount to ensure no infinite loops
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d8d760d5 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d8d760d5 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d8d760d5 Branch: refs/heads/master Commit: d8d760d5e6190b8c32082982d29cd57198d1afaa Parents: b478b97 Author: rpopma <[email protected]> Authored: Wed Sep 20 22:42:51 2017 +0900 Committer: rpopma <[email protected]> Committed: Wed Sep 20 22:42:51 2017 +0900 ---------------------------------------------------------------------- .../apache/logging/log4j/core/PropertiesFileConfigTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d8d760d5/log4j-core/src/test/java/org/apache/logging/log4j/core/PropertiesFileConfigTest.java ---------------------------------------------------------------------- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/PropertiesFileConfigTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/PropertiesFileConfigTest.java index 389c095..4893c68 100644 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/PropertiesFileConfigTest.java +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/PropertiesFileConfigTest.java @@ -55,14 +55,14 @@ public class PropertiesFileConfigTest { assertTrue("setLastModified should have succeeded.", file.setLastModified(newTime)); TimeUnit.SECONDS.sleep(MONITOR_INTERVAL_SECONDS + 1); for (int i = 0; i < 17; ++i) { - logger.debug("Reconfigure"); + logger.info("Reconfigure"); } - final int loopCount = 0; + int loopCount = 0; Configuration newConfig; do { Thread.sleep(100); newConfig = context.getConfiguration(); - } while (newConfig == oldConfig && loopCount < 5); + } while (newConfig == oldConfig && loopCount++ < 5); assertNotSame("Reconfiguration failed", newConfig, oldConfig); } }
