summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2019-07-10 16:22:15 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2019-07-19 14:45:55 +0200
commiteda2e95fa8748813cbcfc7b7fbedefb002999cfa (patch)
tree185c8c939206a25dbad82d41ec4a1f60ab6b6d14 /org.eclipse.jgit.test
parent93144f1438b58264b9fe0dfed195407bc9c0ab1b (diff)
downloadjgit-eda2e95fa8748813cbcfc7b7fbedefb002999cfa.tar.gz
jgit-eda2e95fa8748813cbcfc7b7fbedefb002999cfa.zip
Measure filesystem timestamp resolution already in test setup
This helps to avoid some time critical tests can't prepare the test fixture intended since measuring timestamp resolution takes time. Change-Id: Ib34023e682a106070ca97e98ef16789a4dfb97b4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java3
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java1
2 files changed, 4 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java
index 3031cb944d..f228fb330b 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java
@@ -69,6 +69,9 @@ public class FileSnapshotTest {
@Before
public void setUp() throws Exception {
trash = Files.createTempDirectory("tmp_");
+ // measure timer resolution before the test to avoid time critical tests
+ // are affected by time needed for measurement
+ FS.getFsTimerResolution(trash.getParent());
}
@Before
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java
index 287ad320f2..20a76704c0 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java
@@ -83,6 +83,7 @@ public class FileBasedConfigTest {
@Before
public void setUp() throws Exception {
trash = Files.createTempDirectory("tmp_");
+ FS.getFsTimerResolution(trash.getParent());
}
@After