Merge release branch 4.6 to master

* 4.6:
  Adapted HypervisorUtilsTest to no longer give false positives
This commit is contained in:
Remi Bergsma 2015-12-10 16:24:36 +01:00
commit 312b9aff94

View File

@ -42,9 +42,8 @@ public class HypervisorUtilsTest {
int timeoutSeconds = 5; int timeoutSeconds = 5;
long thresholdMilliseconds = 2000; long thresholdMilliseconds = 2000;
File file = new File(filePath); File file = new File(filePath);
setupcheckVolumeFileForActivityFile(file, 0);
long startTime = System.currentTimeMillis(); long startTime = setupcheckVolumeFileForActivityFile(file, 0);
HypervisorUtils.checkVolumeFileForActivity(filePath, timeoutSeconds, thresholdMilliseconds, _minFileSize); HypervisorUtils.checkVolumeFileForActivity(filePath, timeoutSeconds, thresholdMilliseconds, _minFileSize);
long endTime = System.currentTimeMillis(); long endTime = System.currentTimeMillis();
@ -61,9 +60,8 @@ public class HypervisorUtilsTest {
int timeoutSeconds = 5; int timeoutSeconds = 5;
long thresholdMilliseconds = 2000; long thresholdMilliseconds = 2000;
File file = new File(filePath); File file = new File(filePath);
setupcheckVolumeFileForActivityFile(file, _minFileSize);
long startTime = System.currentTimeMillis(); long startTime = setupcheckVolumeFileForActivityFile(file, _minFileSize);
HypervisorUtils.checkVolumeFileForActivity(filePath, timeoutSeconds, thresholdMilliseconds, _minFileSize); HypervisorUtils.checkVolumeFileForActivity(filePath, timeoutSeconds, thresholdMilliseconds, _minFileSize);
long duration = System.currentTimeMillis() - startTime; long duration = System.currentTimeMillis() - startTime;
@ -93,7 +91,7 @@ public class HypervisorUtilsTest {
System.out.println("Fail"); System.out.println("Fail");
} }
private void setupcheckVolumeFileForActivityFile(File file, long minSize) throws IOException { private long setupcheckVolumeFileForActivityFile(File file, long minSize) throws IOException {
if (file.exists()) { if (file.exists()) {
file.delete(); file.delete();
} }
@ -106,6 +104,8 @@ public class HypervisorUtilsTest {
writer.write(chars); writer.write(chars);
written += chars.length; written += chars.length;
} }
long creationTime = System.currentTimeMillis();
writer.close(); writer.close();
return creationTime;
} }
} }