]> source.dussan.org Git - jgit.git/commit
Add test for racy git detection in FileSnapshot 01/146001/25
authorMatthias Sohn <matthias.sohn@sap.com>
Fri, 12 Jul 2019 07:49:13 +0000 (09:49 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Fri, 26 Jul 2019 13:49:38 +0000 (15:49 +0200)
commit130aa312620cb016dbe8d7ad71bcf38512eb85fe
tree7a9bfa320a4aa425a49a44f18d344c15eb8ccc69
parentde6df3bdd92fe61cb6d4b648aec07593d2c304f8
Add test for racy git detection in FileSnapshot

Repeat the test 10000 times to get statistics if measured
fsTimestampResolution is working in practice to detect racy git
situations.

Add a class to compute statistics for this test. Log delta between
lastModified and time when FileSnapshot failed to detect modification.
This happens if the racy git limit determined by measuring filesystem
timestamp resolution and clock resolution is too small. If it would be
correct FileSnapshot would always detect modification or mark it
modified if time since modification is smaller than the racy git limit.

Change-Id: Iabe7af1a7211ca58480f8902d4fa4e366932fc77
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/util/StatsTest.java [new file with mode: 0644]
org.eclipse.jgit/.settings/.api_filters
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java
org.eclipse.jgit/src/org/eclipse/jgit/util/Stats.java [new file with mode: 0644]