summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2013-01-23 07:55:13 +0100
committerRobin Rosenberg <robin.rosenberg@dewire.com>2013-01-23 07:55:28 +0100
commitdb341527949fe98e56a0a463f74c55398f005a45 (patch)
tree1c4eb259c9ba1c137043885f783aeaac4d372fb7
parent910a69d4c8a892a71f4ac1f8c54f7d91887001d5 (diff)
downloadjgit-db341527949fe98e56a0a463f74c55398f005a45.tar.gz
jgit-db341527949fe98e56a0a463f74c55398f005a45.zip
Attempt to stabilize FileTreeIterator test on Windows
My guess is that the higher resolution of timestamps provided by Java on Windows causes this test to occasionally fail. Bug: 396662 Change-Id: Ia10d76e95fe6156c7ad05972619160e461606805
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java
index bf22569dfb..a416c742f8 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java
@@ -253,14 +253,16 @@ public class FileTreeIteratorTest extends RepositoryTestCase {
// Hopefully fsTick will make sure our entry gets smudged
fsTick(f);
writeTrashFile("file", "content");
+ long lastModified = f.lastModified();
git.add().addFilepattern("file").call();
writeTrashFile("file", "conten2");
+ f.setLastModified(lastModified);
DirCacheEntry dce = db.readDirCache().getEntry("file");
FileTreeIterator fti = new FileTreeIterator(trash, db.getFS(), db
.getConfig().get(WorkingTreeOptions.KEY));
while (!fti.getEntryPathString().equals("file"))
fti.next(1);
- // If the fsTick trick does not work we could skip the compareMetaData
+ // If the rounding trick does not work we could skip the compareMetaData
// test and hope that we are usually testing the intended code path.
assertEquals(MetadataDiff.SMUDGED, fti.compareMetadata(dce));
assertTrue(fti.isModified(dce, false));