Skip to content

Commit

Permalink
util: Increase modtime in AdvancedTlsX509TrustManagerTest
Browse files Browse the repository at this point in the history
I noticed an old JDK 8u275 failed on the test because the modification
time's resolution was one second. A newer JDK 8u432 worked fine, so it's
not really a problem for me, but increasing the time difference is
cheap. I used two seconds as that's the resolution available on FAT
(which is unlikely to be TMPDIR, even on Windows).
  • Loading branch information
ejona86 committed Jan 10, 2025
1 parent 70825ad commit 82403b9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public void updateTrustCredentials_rotate() throws GeneralSecurityException, IOE
fakeClock.forwardTime(1, TimeUnit.MINUTES);
assertArrayEquals(serverCert0, trustManager.getAcceptedIssuers());

serverCert0File.setLastModified(serverCert0File.lastModified() - 10);
serverCert0File.setLastModified(serverCert0File.lastModified() - 2000);

fakeClock.forwardTime(1, TimeUnit.MINUTES);
assertArrayEquals(serverCert0, trustManager.getAcceptedIssuers());
Expand All @@ -181,7 +181,7 @@ public void updateTrustCredentials_rotate() throws GeneralSecurityException, IOE
fakeClock.forwardTime(1, TimeUnit.MINUTES);
assertArrayEquals(serverCert0, trustManager.getAcceptedIssuers());

serverCert0File.setLastModified(beforeModify + 10);
serverCert0File.setLastModified(beforeModify + 2000);

// file modification time changed
fakeClock.forwardTime(1, TimeUnit.MINUTES);
Expand Down

0 comments on commit 82403b9

Please sign in to comment.