From eda2e95fa8748813cbcfc7b7fbedefb002999cfa Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Wed, 10 Jul 2019 16:22:15 +0200 Subject: 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 --- .../src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'org.eclipse.jgit.junit') diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java index 50e6f2da5a..af688d2349 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java @@ -127,6 +127,10 @@ public abstract class LocalDiskRepositoryTestCase { if (!tmp.delete() || !tmp.mkdir()) throw new IOException("Cannot create " + tmp); + // measure timer resolution before the test to avoid time critical tests + // are affected by time needed for measurement + FS.getFsTimerResolution(tmp.toPath().getParent()); + mockSystemReader = new MockSystemReader(); mockSystemReader.userGitConfig = new FileBasedConfig(new File(tmp, "usergitconfig"), FS.DETECTED); -- cgit v1.2.3