[java-identity-provider] 04/04: Add Dither to delay to account for windows/J11 issues

Rod Widdowson rdw at steadingsoftware.com
Fri Apr 12 08:01:25 EDT 2019


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=a9e6fea0bb7a468b08a591c99372ff9bdc69cab0

commit a9e6fea0bb7a468b08a591c99372ff9bdc69cab0
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Fri Apr 12 10:48:50 2019 +0100

    Add Dither to delay to account for windows/J11 issues
---
 .../metadata/LocalDynamicMetadataProviderParserTest.java            | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/LocalDynamicMetadataProviderParserTest.java b/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/LocalDynamicMetadataProviderParserTest.java
index d2183f1..12ea9fa 100644
--- a/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/LocalDynamicMetadataProviderParserTest.java
+++ b/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/LocalDynamicMetadataProviderParserTest.java
@@ -50,6 +50,8 @@ public class LocalDynamicMetadataProviderParserTest extends AbstractMetadataPars
     
     private File sourceDirectory;
     
+    private final int TIME_GRANULARITY_MS = 25; // Dither for Windows clocks
+    
     @BeforeMethod
     public void setUp() {
         sourceDirectory = new File(System.getProperty("java.io.tmpdir"), "localDynamicMD");
@@ -127,7 +129,7 @@ public class LocalDynamicMetadataProviderParserTest extends AbstractMetadataPars
         Assert.assertNull(resolver.resolveSingle(criteria));
         
         // Sleep past the negative lookup cache expiration
-        Uninterruptibles.sleepUninterruptibly(resolver.getNegativeLookupCacheDuration().toMillis(), TimeUnit.MILLISECONDS);
+        Uninterruptibles.sleepUninterruptibly(resolver.getNegativeLookupCacheDuration().toMillis()+TIME_GRANULARITY_MS, TimeUnit.MILLISECONDS);
         
         // In this case, will be the same instance since using in-memory map-based store.
         Assert.assertSame(resolver.resolveSingle(criteria), entity);
@@ -167,7 +169,7 @@ public class LocalDynamicMetadataProviderParserTest extends AbstractMetadataPars
         Assert.assertNull(resolver.resolveSingle(criteria));
         
         // Sleep past the negative lookup cache expiration
-        Uninterruptibles.sleepUninterruptibly(resolver.getNegativeLookupCacheDuration().toMillis(), TimeUnit.MILLISECONDS);
+        Uninterruptibles.sleepUninterruptibly(resolver.getNegativeLookupCacheDuration().toMillis()+TIME_GRANULARITY_MS, TimeUnit.MILLISECONDS);
         
         EntityDescriptor resolved = resolver.resolveSingle(criteria);
         Assert.assertNotNull(resolved);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list