|
47 | 47 | import org.eclipse.jgit.lib.ObjectId; |
48 | 48 | import org.jenkinsci.plugins.gitclient.Git; |
49 | 49 | import org.jenkinsci.plugins.gitclient.GitClient; |
| 50 | +import org.junit.Assume; |
50 | 51 | import org.junit.BeforeClass; |
51 | 52 | import org.junit.ClassRule; |
52 | 53 | import org.junit.Rule; |
@@ -194,20 +195,21 @@ public void slashyBranches() throws Exception { |
194 | 195 |
|
195 | 196 | @Test |
196 | 197 | public void lastModified_Smokes() throws Exception { |
| 198 | + Assume.assumeTrue("Windows file system last modify dates not trustworthy", !isWindows()); |
197 | 199 | sampleRepo.init(); |
198 | 200 | sampleRepo.git("checkout", "-b", "dev"); |
199 | 201 | SCMSource source = new GitSCMSource(null, sampleRepo.toString(), "", "*", "", true); |
200 | 202 | SCMRevision revision = source.fetch(new GitBranchSCMHead("dev"), null); |
201 | 203 | sampleRepo.write("file", "modified"); |
202 | 204 | sampleRepo.git("commit", "--all", "--message=dev"); |
203 | | - final long fileSystemAllowedOffset = isWindows() ? 4000 : 1500; |
| 205 | + final long fileSystemAllowedOffset = 1500; |
204 | 206 | SCMFileSystem fs = SCMFileSystem.of(source, new SCMHead("dev"), revision); |
205 | | - long currentTime = isWindows() ? System.currentTimeMillis() / 1000L * 1000L : System.currentTimeMillis(); |
| 207 | + long currentTime = System.currentTimeMillis(); |
206 | 208 | long lastModified = fs.lastModified(); |
207 | 209 | assertThat(lastModified, greaterThanOrEqualTo(currentTime - fileSystemAllowedOffset)); |
208 | 210 | assertThat(lastModified, lessThanOrEqualTo(currentTime + fileSystemAllowedOffset)); |
209 | 211 | SCMFile file = fs.getRoot().child("file"); |
210 | | - currentTime = isWindows() ? System.currentTimeMillis() / 1000L * 1000L : System.currentTimeMillis(); |
| 212 | + currentTime = System.currentTimeMillis(); |
211 | 213 | lastModified = file.lastModified(); |
212 | 214 | assertThat(lastModified, greaterThanOrEqualTo(currentTime - fileSystemAllowedOffset)); |
213 | 215 | assertThat(lastModified, lessThanOrEqualTo(currentTime + fileSystemAllowedOffset)); |
|
0 commit comments