[java-shib-attribute] branch main updated: Introduce a wait if open connections are found.

Daniel Fisher dfisher at vt.edu
Wed Nov 16 00:37:07 UTC 2022


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

dfisher pushed a commit to branch main
in repository java-shib-attribute.

View the commit online:
http://git.shibboleth.net/view/?p=java-shib-attribute.git;a=commit;h=96279a4cfe4fa9ac0ea4304a670b0b950301a4f3

The following commit(s) were added to refs/heads/main by this push:
     new 96279a4cf Introduce a wait if open connections are found.
96279a4cf is described below

commit 96279a4cfe4fa9ac0ea4304a670b0b950301a4f3
Author: Daniel Fisher <dfisher at vt.edu>
AuthorDate: Tue Nov 15 19:34:47 2022 -0500

    Introduce a wait if open connections are found.
    
    Nightly test infrastructure may be taking longer for the Socket to set the isClosed flag.
---
 .../idp/attribute/resolver/dc/ldap/impl/LDAPDataConnectorTest.java   | 5 ++++-
 .../shibboleth/idp/attribute/resolver/dc/ldap/impl/Regressions.java  | 5 ++++-
 .../resolver/spring/failfast/AttributeResolverFailFastTest.java      | 5 ++++-
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/ldap/impl/LDAPDataConnectorTest.java b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/ldap/impl/LDAPDataConnectorTest.java
index 4c2335c19..3d954f48f 100644
--- a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/ldap/impl/LDAPDataConnectorTest.java
+++ b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/ldap/impl/LDAPDataConnectorTest.java
@@ -96,7 +96,10 @@ public class LDAPDataConnectorTest {
     /**
      * Shutdown the in-memory directory server.
      */
-    @AfterClass public void teardownDirectoryServer() {
+    @AfterClass public void teardownDirectoryServer() throws Exception {
+        if (directoryServer.openConnectionCount() > 0) {
+            Thread.sleep(100);
+        }
         assertEquals(directoryServer.openConnectionCount(), 0);
         directoryServer.stop(true);
     }
diff --git a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/ldap/impl/Regressions.java b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/ldap/impl/Regressions.java
index aea23948f..d3edaf2e2 100644
--- a/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/ldap/impl/Regressions.java
+++ b/shib-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/ldap/impl/Regressions.java
@@ -80,7 +80,10 @@ public class Regressions {
     /**
      * Shutdown the in-memory directory server.
      */
-    @AfterClass public void teardownDirectoryServer() {
+    @AfterClass public void teardownDirectoryServer() throws Exception {
+        if (directoryServer.openConnectionCount() > 0) {
+            Thread.sleep(100);
+        }
         assertEquals(directoryServer.openConnectionCount(), 0);
         directoryServer.stop(true);
     }
diff --git a/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/failfast/AttributeResolverFailFastTest.java b/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/failfast/AttributeResolverFailFastTest.java
index b69da76e5..1d71f2130 100644
--- a/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/failfast/AttributeResolverFailFastTest.java
+++ b/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/failfast/AttributeResolverFailFastTest.java
@@ -73,8 +73,11 @@ public class AttributeResolverFailFastTest extends AbstractFailFastTest {
 
     }
     
-    @AfterClass public void teardownDirectoryServer() {
+    @AfterClass public void teardownDirectoryServer() throws Exception {
         if (directoryServer != null) {
+            if (directoryServer.openConnectionCount() > 0) {
+                Thread.sleep(100);
+            }
             assertEquals(directoryServer.openConnectionCount(), 0);
             directoryServer.stop(true);
         }

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


More information about the commits mailing list