Clarify the reason of the sleep time

This commit is contained in:
Andrea Bollini
2020-02-27 15:31:10 +01:00
parent be410e2cb8
commit cb83c4c161

View File

@@ -33,6 +33,12 @@ import org.junit.Ignore;
@Ignore @Ignore
public class AbstractIntegrationTest extends AbstractUnitTest { 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 <code>dspace/config/config-definition.xml</code>
*/
private static final int CONFIG_RELOAD_TIME = 5500;
/** /**
* holds the size of the local.cfg file, see {@link #cleanExtraConfigurations()} * 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) FileChannel.open(Paths.get(extraConfPath), StandardOpenOption.WRITE)
.truncate(initialLocalCfgSize).close(); .truncate(initialLocalCfgSize).close();
localCfgChanged = false; localCfgChanged = false;
// sleep for 5.5 seconds to give the time to the configuration to note the change // sleep to give the time to the configuration to note the change
Thread.sleep(5500); Thread.sleep(CONFIG_RELOAD_TIME);
} catch (IOException | InterruptedException e) { } catch (IOException | InterruptedException e) {
throw new RuntimeException(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e);
} }
@@ -118,8 +124,8 @@ public class AbstractIntegrationTest extends AbstractUnitTest {
output.flush(); output.flush();
output.close(); output.close();
localCfgChanged = true; localCfgChanged = true;
// sleep for 5.5 seconds to give the time to the configuration to note the change // sleep to give the time to the configuration to note the change
Thread.sleep(5500); Thread.sleep(CONFIG_RELOAD_TIME);
} catch (IOException | InterruptedException e) { } catch (IOException | InterruptedException e) {
throw new RuntimeException(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e);
} }