From cb83c4c1618a49c6b07d27be15e24270c318f82a Mon Sep 17 00:00:00 2001 From: Andrea Bollini Date: Thu, 27 Feb 2020 15:31:10 +0100 Subject: [PATCH] Clarify the reason of the sleep time --- .../java/org/dspace/AbstractIntegrationTest.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dspace-api/src/test/java/org/dspace/AbstractIntegrationTest.java b/dspace-api/src/test/java/org/dspace/AbstractIntegrationTest.java index f5817e51dc..d437a77385 100644 --- a/dspace-api/src/test/java/org/dspace/AbstractIntegrationTest.java +++ b/dspace-api/src/test/java/org/dspace/AbstractIntegrationTest.java @@ -33,6 +33,12 @@ import org.junit.Ignore; @Ignore public class AbstractIntegrationTest extends AbstractUnitTest { + /** + * this is the amount of time that guarantee us that changes to the configuration files are picked up. + * The actual refresh rate is defined in dspace/config/config-definition.xml + */ + private static final int CONFIG_RELOAD_TIME = 5500; + /** * holds the size of the local.cfg file, see {@link #cleanExtraConfigurations()} **/ @@ -87,8 +93,8 @@ public class AbstractIntegrationTest extends AbstractUnitTest { FileChannel.open(Paths.get(extraConfPath), StandardOpenOption.WRITE) .truncate(initialLocalCfgSize).close(); localCfgChanged = false; - // sleep for 5.5 seconds to give the time to the configuration to note the change - Thread.sleep(5500); + // sleep to give the time to the configuration to note the change + Thread.sleep(CONFIG_RELOAD_TIME); } catch (IOException | InterruptedException e) { throw new RuntimeException(e.getMessage(), e); } @@ -118,8 +124,8 @@ public class AbstractIntegrationTest extends AbstractUnitTest { output.flush(); output.close(); localCfgChanged = true; - // sleep for 5.5 seconds to give the time to the configuration to note the change - Thread.sleep(5500); + // sleep to give the time to the configuration to note the change + Thread.sleep(CONFIG_RELOAD_TIME); } catch (IOException | InterruptedException e) { throw new RuntimeException(e.getMessage(), e); }