Skip to content

Commit 82403b9

Browse files
committed
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).
1 parent 70825ad commit 82403b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

util/src/test/java/io/grpc/util/AdvancedTlsX509TrustManagerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public void updateTrustCredentials_rotate() throws GeneralSecurityException, IOE
168168
fakeClock.forwardTime(1, TimeUnit.MINUTES);
169169
assertArrayEquals(serverCert0, trustManager.getAcceptedIssuers());
170170

171-
serverCert0File.setLastModified(serverCert0File.lastModified() - 10);
171+
serverCert0File.setLastModified(serverCert0File.lastModified() - 2000);
172172

173173
fakeClock.forwardTime(1, TimeUnit.MINUTES);
174174
assertArrayEquals(serverCert0, trustManager.getAcceptedIssuers());
@@ -181,7 +181,7 @@ public void updateTrustCredentials_rotate() throws GeneralSecurityException, IOE
181181
fakeClock.forwardTime(1, TimeUnit.MINUTES);
182182
assertArrayEquals(serverCert0, trustManager.getAcceptedIssuers());
183183

184-
serverCert0File.setLastModified(beforeModify + 10);
184+
serverCert0File.setLastModified(beforeModify + 2000);
185185

186186
// file modification time changed
187187
fakeClock.forwardTime(1, TimeUnit.MINUTES);

0 commit comments

Comments
 (0)