github-rmslash-com commented on PR #165:
URL: 
https://github.com/apache/directory-ldap-api/pull/165#issuecomment-2558402810

   Hi,
   
   I reviewed the test and tried to analyze.
   
   I committed a fix to the branch:
   
   
https://github.com/github-rmslash-com/directory-ldap-api/commit/b6a5c2234bf0623ec7021862f85724733f646be1
   
   
   in LdapConnectionPool i added the check if a PooledLdapConnection is 
   passed (to make sure that old code which uses the releaseConnection 
   method in the pool) is also working.
   
   The problem with the test was that the validator operates on the 
   underlying object in the pool (The MonitoredLdapConnection). The test 
   checked for a validation of the PooledLdapConnection, but the wrapped 
   object is being validated. Therefore the test directly run into the 
   finally block because the first validation in the try block failed 
   (before withConnection#execute is being performed).
   
   By unwrapping the PooledLdapConnection during the validation test, the 
   test finishes successfully.
   
   I also tried locally a full build using mvn package verify - everything 
   green now....
   
   [INFO] 
   ------------------------------------------------------------------------
   [INFO] Reactor Summary for Apache Directory LDAP API 2.1.8-SNAPSHOT:
   [INFO]
   [INFO] Apache Directory LDAP API .......................... SUCCESS [ 
   4.979 s]
   [INFO] Apache Directory LDAP API I18n ..................... SUCCESS [ 
   0.458 s]
   [INFO] Apache Directory LDAP API Utilities ................ SUCCESS [ 
   1.080 s]
   [INFO] Apache Directory API ASN.1 Parent .................. SUCCESS [ 
   0.067 s]
   [INFO] Apache Directory API ASN.1 API ..................... SUCCESS [ 
   0.809 s]
   [INFO] Apache Directory API ASN.1 BER ..................... SUCCESS [ 
   1.244 s]
   [INFO] Apache Directory LDAP API Parent ................... SUCCESS [ 
   0.062 s]
   [INFO] Apache Directory LDAP API Model .................... SUCCESS [ 
   6.034 s]
   [INFO] Apache Directory LDAP API Codec Parent ............. SUCCESS [ 
   0.062 s]
   [INFO] Apache Directory LDAP API Codec Core ............... SUCCESS [ 
   4.811 s]
   [INFO] Apache Directory LDAP API Net Parent ............... SUCCESS [ 
   0.043 s]
   [INFO] Apache Directory LDAP API Network MINA ............. SUCCESS [ 
   0.295 s]
   [INFO] Apache Directory LDAP API Extras Parent ............ SUCCESS [ 
   0.047 s]
   [INFO] Apache Directory LDAP API Extras Codec API ......... SUCCESS [ 
   0.461 s]
   [INFO] Apache Directory LDAP API Extras Codec ............. SUCCESS [ 
   1.445 s]
   [INFO] Apache Directory LDAP API Codec Standalone ......... SUCCESS [ 
   0.445 s]
   [INFO] Apache Directory LDAP API DSML Parent .............. SUCCESS [ 
   0.037 s]
   [INFO] Apache Directory LDAP API DSML Parser .............. SUCCESS [ 
   1.646 s]
   [INFO] Apache Directory LDAP API Extras ACI ............... SUCCESS [ 
   1.185 s]
   [INFO] Apache Directory LDAP API Schema Parent ............ SUCCESS [ 
   0.039 s]
   [INFO] Apache Directory LDAP API Schema Data .............. SUCCESS [ 
   8.320 s]
   [INFO] Apache Directory LDAP API Client Parent ............ SUCCESS [ 
   0.039 s]
   [INFO] Apache Directory LDAP API Client API ............... SUCCESS [ 
   2.386 s]
   [INFO] Apache Directory LDAP API DSML Engine .............. SUCCESS [ 
   0.399 s]
   [INFO] Apache Directory LDAP API Extras Util .............. SUCCESS [ 
   0.954 s]
   [INFO] Apache Directory LDAP API Extras Stored Procedures . SUCCESS [ 
   0.351 s]
   [INFO] Apache Directory LDAP API Extras Trigger ........... SUCCESS [ 
   0.962 s]
   [INFO] Apache Directory LDAP API Schema Converter ......... SUCCESS [ 
   1.037 s]
   [INFO] Apache Directory API All ........................... SUCCESS [ 
   0.806 s]
   [INFO] Apache Directory LDAP API Client All ............... SUCCESS [ 
   6.655 s]
   [INFO] Apache Directory API Integration Tests ............. SUCCESS [ 
   2.989 s]
   [INFO] Apache Directory API OSGi Integration Tests ........ SUCCESS [ 
   27.740 s]
   [INFO] Apache Directory LDAP API Distribution ............. SUCCESS [ 
   0.412 s]
   [INFO] 
   ------------------------------------------------------------------------
   [INFO] BUILD SUCCESS
   [INFO] 
   ------------------------------------------------------------------------
   [INFO] Total time:  01:18 min
   [INFO] Finished at: 2024-12-22T11:08:16+01:00
   [INFO] 
   ------------------------------------------------------------------------
   ***@***.***:~/git/rmslash/directory-ldap-api$
   
   
   
   Thanks for your patience and your support.
   
   Andreas
   
   
   
   Am 22.12.24 um 08:59 schrieb Emmanuel Lécharny:
   > Hi,
   > 
   > when applying the patch, and running the tests, I gt 2 errors:
   > 
   > `[ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 
   > 0.148 s <<< FAILURE! -- in 
   > 
org.apache.directory.ldap.client.api.ValidatingPoolableLdapConnectionFactoryTest
   > [ERROR] 
   > 
org.apache.directory.ldap.client.api.ValidatingPoolableLdapConnectionFactoryTest.testPoolWithStartTls
 -- Time elapsed: 0.125 s <<< ERROR!
   > java.lang.RuntimeException: java.lang.IllegalStateException: Returned 
   > object not currently part of this pool
   > at 
   > 
org.apache.directory.ldap.client.api.LdapConnectionPool.releaseConnection(LdapConnectionPool.java:184)
   > at 
   > 
org.apache.directory.ldap.client.api.ValidatingPoolableLdapConnectionFactoryTest$PoolTester.execute(ValidatingPoolableLdapConnectionFactoryTest.java:535)
   > at 
   > 
org.apache.directory.ldap.client.api.ValidatingPoolableLdapConnectionFactoryTest.testPoolWithStartTls(ValidatingPoolableLdapConnectionFactoryTest.java:182)
   > at java.lang.reflect.Method.invoke(Method.java:498)
   > at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
   > at 
   > java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
   > at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
   > at 
   > 
java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)
   > Caused by: java.lang.IllegalStateException: Returned object not 
   > currently part of this pool
   > at 
   > 
org.apache.commons.pool2.impl.GenericObjectPool.returnObject(GenericObjectPool.java:1031)
   > at 
   > 
org.apache.directory.ldap.client.api.LdapConnectionPool.releaseConnection(LdapConnectionPool.java:171)
   > ... 7 more
   > 
   > [ERROR] 
   > 
org.apache.directory.ldap.client.api.ValidatingPoolableLdapConnectionFactoryTest.testPoolWithBind
 -- Time elapsed: 0.006 s <<< ERROR!
   > java.lang.RuntimeException: java.lang.IllegalStateException: Returned 
   > object not currently part of this pool
   > at 
   > 
org.apache.directory.ldap.client.api.LdapConnectionPool.releaseConnection(LdapConnectionPool.java:184)
   > at 
   > 
org.apache.directory.ldap.client.api.ValidatingPoolableLdapConnectionFactoryTest$PoolTester.execute(ValidatingPoolableLdapConnectionFactoryTest.java:535)
   > at 
   > 
org.apache.directory.ldap.client.api.ValidatingPoolableLdapConnectionFactoryTest.testPoolWithBind(ValidatingPoolableLdapConnectionFactoryTest.java:58)
   > at java.lang.reflect.Method.invoke(Method.java:498)
   > at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
   > at 
   > java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
   > at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
   > at 
   > 
java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)
   > Caused by: java.lang.IllegalStateException: Returned object not 
   > currently part of this pool
   > at 
   > 
org.apache.commons.pool2.impl.GenericObjectPool.returnObject(GenericObjectPool.java:1031)
   > at 
   > 
org.apache.directory.ldap.client.api.LdapConnectionPool.releaseConnection(LdapConnectionPool.java:171)
   > ... 7 more
   > 
   > [INFO]
   > [INFO] Results:
   > [INFO]
   > [ERROR] Errors:
   > [ERROR] ValidatingPoolableLdapConnectionFactoryTest.testPoolWithBind:58 
   > » Runtime java.lang.IllegalStateException: Returned object not currently 
   > part of this pool
   > [ERROR] 
   > ValidatingPoolableLdapConnectionFactoryTest.testPoolWithStartTls:182 » 
   > Runtime java.lang.IllegalStateException: Returned object not currently 
   > part of this pool
   > [INFO]
   > [ERROR] Tests run: 46, Failures: 0, Errors: 2, Skipped: 0
   > [INFO]
   > `
   > 
   > —
   > Reply to this email directly, view it on GitHub <https://github.com/ 
   > apache/directory-ldap-api/pull/165#issuecomment-2558367690>, or 
   > unsubscribe <https://github.com/notifications/unsubscribe-auth/ 
   > 
ATI27QJGI34PXQ6XYUKMPH32GZWPNAVCNFSM6AAAAABUAUW6ESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNJYGM3DONRZGA>.
   > You are receiving this because you authored the thread.Message ID: 
   > ***@***.***>
   > 
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@directory.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@directory.apache.org
For additional commands, e-mail: dev-h...@directory.apache.org

Reply via email to