mirror of https://github.com/grpc/grpc-java.git
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:
parent
70825adce6
commit
82403b9bfa
|
@ -168,7 +168,7 @@ public class AdvancedTlsX509TrustManagerTest {
|
||||||
fakeClock.forwardTime(1, TimeUnit.MINUTES);
|
fakeClock.forwardTime(1, TimeUnit.MINUTES);
|
||||||
assertArrayEquals(serverCert0, trustManager.getAcceptedIssuers());
|
assertArrayEquals(serverCert0, trustManager.getAcceptedIssuers());
|
||||||
|
|
||||||
serverCert0File.setLastModified(serverCert0File.lastModified() - 10);
|
serverCert0File.setLastModified(serverCert0File.lastModified() - 2000);
|
||||||
|
|
||||||
fakeClock.forwardTime(1, TimeUnit.MINUTES);
|
fakeClock.forwardTime(1, TimeUnit.MINUTES);
|
||||||
assertArrayEquals(serverCert0, trustManager.getAcceptedIssuers());
|
assertArrayEquals(serverCert0, trustManager.getAcceptedIssuers());
|
||||||
|
@ -181,7 +181,7 @@ public class AdvancedTlsX509TrustManagerTest {
|
||||||
fakeClock.forwardTime(1, TimeUnit.MINUTES);
|
fakeClock.forwardTime(1, TimeUnit.MINUTES);
|
||||||
assertArrayEquals(serverCert0, trustManager.getAcceptedIssuers());
|
assertArrayEquals(serverCert0, trustManager.getAcceptedIssuers());
|
||||||
|
|
||||||
serverCert0File.setLastModified(beforeModify + 10);
|
serverCert0File.setLastModified(beforeModify + 2000);
|
||||||
|
|
||||||
// file modification time changed
|
// file modification time changed
|
||||||
fakeClock.forwardTime(1, TimeUnit.MINUTES);
|
fakeClock.forwardTime(1, TimeUnit.MINUTES);
|
||||||
|
|
Loading…
Reference in New Issue