util: Increase modtime in AdvancedTlsX509TrustManagerTest

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).
This commit is contained in:
Eric Anderson 2025-01-09 15:04:25 -08:00
parent 70825adce6
commit 82403b9bfa
1 changed files with 2 additions and 2 deletions

View File

@ -168,7 +168,7 @@ public class AdvancedTlsX509TrustManagerTest {
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());
@ -181,7 +181,7 @@ public class AdvancedTlsX509TrustManagerTest {
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);