Re: ApacheDS and API test issues

2019-07-09 Thread Stefan Seelmann
On 7/8/19 5:12 PM, Emmanuel Lécharny wrote:
>> * ClientAddRequestTest sometimes hangs forever. I was able to reproduce
>> on my machine when running it multiple times. It waits forever for a
>> future, see thread dump below.
> 
> 
> I'll investigate this one.
> 
> 
>>
>>     java.lang.Thread.State: TIMED_WAITING (on object monitor)
>>  at java.lang.Object.wait(Native Method)
>>  - waiting on <0x0007794c4780> (a
>> org.apache.directory.ldap.client.api.future.AddFuture)
>>  at
>> org.apache.directory.ldap.client.api.future.UniqueResponseFuture.get(UniqueResponseFuture.java:90)

This should be fixed. Issue was that the UniqueResponseFuture always
waited, even when it was already done, then it waited for the timeout
what is by default 30 seconds. Same fix applied in HandshakeFuture.

See commits d51054d003d4ca6c0f2d505de9d081ced9587078 and
b9c3f3d8f8ac7e0955741f77a6ab5018fa263800


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



Re: ApacheDS and API test issues

2019-07-09 Thread Emmanuel Lécharny



On 09/07/2019 16:08, Stefan Seelmann wrote:

On 7/8/19 5:12 PM, Emmanuel Lécharny wrote:

* ClientAddRequestTest sometimes hangs forever. I was able to reproduce
on my machine when running it multiple times. It waits forever for a
future, see thread dump below.


I'll investigate this one.



     java.lang.Thread.State: TIMED_WAITING (on object monitor)
  at java.lang.Object.wait(Native Method)
  - waiting on <0x0007794c4780> (a
org.apache.directory.ldap.client.api.future.AddFuture)
  at
org.apache.directory.ldap.client.api.future.UniqueResponseFuture.get(UniqueResponseFuture.java:90)

This should be fixed. Issue was that the UniqueResponseFuture always
waited, even when it was already done, then it waited for the timeout
what is by default 30 seconds. Same fix applied in HandshakeFuture.



Thanks a lot and congrats for the fix !



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



Re: [directory-server] branch master updated: Speed up tests, reduce number of iterations

2019-07-09 Thread Emmanuel Lécharny

Hi Stefan,

setting the number of loops down to 100 instead of 1000 will make the 
test successful. The idea was to have enough element so that the cache 
would break, and it's only failing when the number of added element grow 
to > 650.



I suggest we simply @Ignore this test.


On 09/07/2019 16:55, seelm...@apache.org wrote:

This is an automated email from the ASF dual-hosted git repository.

seelmann pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-server.git


The following commit(s) were added to refs/heads/master by this push:
  new 278d52e  Speed up tests, reduce number of iterations
278d52e is described below

commit 278d52e79dc93cfdd5bfe939bb62a6880c268da2
Author: Stefan Seelmann 
AuthorDate: Tue Jul 9 16:52:52 2019 +0200

 Speed up tests, reduce number of iterations
---
  .../operations/search/OperationWithIndexTest.java  |  6 ++---
  .../server/operations/bind/DelegatedAuthIT.java|  5 
  .../operations/modifydn/DIRSERVER_1974_IT.java | 29 +-
  3 files changed, 20 insertions(+), 20 deletions(-)

diff --git 
a/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/OperationWithIndexTest.java
 
b/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/OperationWithIndexTest.java
index 8593459..e88bc34 100644
--- 
a/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/OperationWithIndexTest.java
+++ 
b/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/OperationWithIndexTest.java
@@ -823,7 +823,7 @@ public class OperationWithIndexTest extends 
AbstractLdapTestUnit
  @Test
  public void testSearchWithIndex() throws Exception
  {
-int nbIterations = 1000;
+int nbIterations = 100;
  
  //BufferedWriter out = new BufferedWriter( new FileWriter("/tmp/out.txt") );
  
@@ -868,7 +868,7 @@ public class OperationWithIndexTest extends AbstractLdapTestUnit
  
  
  // Now search the entry from the root

-EntryCursor cursor = connection.search( "", 
"(uniqueMember=cn=user784,dc=test,dc=com)", SearchScope.SUBTREE );
+EntryCursor cursor = connection.search( "", 
"(uniqueMember=cn=user78,dc=test,dc=com)", SearchScope.SUBTREE );
  List entries = new ArrayList();
  
  while ( cursor.next() )

@@ -883,7 +883,7 @@ public class OperationWithIndexTest extends 
AbstractLdapTestUnit
  assertNotNull( done );
  assertEquals( ResultCodeEnum.SUCCESS, 
done.getLdapResult().getResultCode() );
  assertEquals( 1, entries.size() );
-assertTrue( entries.contains( "cn=user784,dc=test,dc=com" ) );
+assertTrue( entries.contains( "cn=user78,dc=test,dc=com" ) );
  cursor.close();
  }
  }
diff --git 
a/server-integ/src/test/java/org/apache/directory/server/operations/bind/DelegatedAuthIT.java
 
b/server-integ/src/test/java/org/apache/directory/server/operations/bind/DelegatedAuthIT.java
index 91f67ac..c43afcc 100644
--- 
a/server-integ/src/test/java/org/apache/directory/server/operations/bind/DelegatedAuthIT.java
+++ 
b/server-integ/src/test/java/org/apache/directory/server/operations/bind/DelegatedAuthIT.java
@@ -26,7 +26,6 @@ import static org.junit.Assert.fail;
  
  import org.apache.directory.api.ldap.model.exception.LdapAuthenticationException;

  import org.apache.directory.api.util.Network;
-import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
  import org.apache.directory.ldap.client.api.LdapConnection;
  import org.apache.directory.ldap.client.api.LdapNetworkConnection;
  import org.apache.directory.server.annotations.CreateLdapServer;
@@ -37,7 +36,6 @@ import org.apache.directory.server.core.annotations.CreateDS;
  import org.apache.directory.server.core.authn.DelegatingAuthenticator;
  import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
  import org.apache.directory.server.core.integ.FrameworkRunner;
-import org.junit.Rule;
  import org.junit.Test;
  import org.junit.runner.RunWith;
  
@@ -77,9 +75,6 @@ import org.junit.runner.RunWith;

  public class DelegatedAuthIT extends AbstractLdapTestUnit
  {
  
-@Rule

-public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( 1, 
1000 );
-
  
  /**

   * Test with bindDn which is not even found under any namingContext of the
diff --git 
a/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/DIRSERVER_1974_IT.java
 
b/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/DIRSERVER_1974_IT.java
index a74fd17..7f8829f 100755
--- 
a/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/DIRSERVER_1974_IT.java
+++ 
b/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/DIRSERVER_1974_IT.java
@@ -126,6 +126,14 @@ public class DIRSERVER_1974_IT extends AbstractLdapTestUnit
  private static final Logger lo

Re: [directory-server] branch master updated: Speed up tests, reduce number of iterations

2019-07-09 Thread Stefan Seelmann
Ok, reverted. Let's first see how tests on Jenkins look like, then
ignore if required.

On 7/9/19 5:00 PM, Emmanuel Lécharny wrote:
> Hi Stefan,
> 
> setting the number of loops down to 100 instead of 1000 will make the
> test successful. The idea was to have enough element so that the cache
> would break, and it's only failing when the number of added element grow
> to > 650.
> 
> 
> I suggest we simply @Ignore this test.
> 
> 
> On 09/07/2019 16:55, seelm...@apache.org wrote:
>> This is an automated email from the ASF dual-hosted git repository.
>>
>> seelmann pushed a commit to branch master
>> in repository https://gitbox.apache.org/repos/asf/directory-server.git
>>
>>
>> The following commit(s) were added to refs/heads/master by this push:
>>   new 278d52e  Speed up tests, reduce number of iterations
>> 278d52e is described below
>>
>> commit 278d52e79dc93cfdd5bfe939bb62a6880c268da2
>> Author: Stefan Seelmann 
>> AuthorDate: Tue Jul 9 16:52:52 2019 +0200
>>
>>  Speed up tests, reduce number of iterations
>> ---
>>   .../operations/search/OperationWithIndexTest.java  |  6 ++---
>>   .../server/operations/bind/DelegatedAuthIT.java    |  5 
>>   .../operations/modifydn/DIRSERVER_1974_IT.java | 29
>> +-
>>   3 files changed, 20 insertions(+), 20 deletions(-)
>>
>> diff --git
>> a/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/OperationWithIndexTest.java
>> b/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/OperationWithIndexTest.java
>>
>> index 8593459..e88bc34 100644
>> ---
>> a/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/OperationWithIndexTest.java
>>
>> +++
>> b/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/OperationWithIndexTest.java
>>
>> @@ -823,7 +823,7 @@ public class OperationWithIndexTest extends
>> AbstractLdapTestUnit
>>   @Test
>>   public void testSearchWithIndex() throws Exception
>>   {
>> -    int nbIterations = 1000;
>> +    int nbIterations = 100;
>>     //BufferedWriter out = new BufferedWriter( new
>> FileWriter("/tmp/out.txt") );
>>   @@ -868,7 +868,7 @@ public class OperationWithIndexTest extends
>> AbstractLdapTestUnit
>>       // Now search the entry from the root
>> -    EntryCursor cursor = connection.search( "",
>> "(uniqueMember=cn=user784,dc=test,dc=com)", SearchScope.SUBTREE );
>> +    EntryCursor cursor = connection.search( "",
>> "(uniqueMember=cn=user78,dc=test,dc=com)", SearchScope.SUBTREE );
>>   List entries = new ArrayList();
>>     while ( cursor.next() )
>> @@ -883,7 +883,7 @@ public class OperationWithIndexTest extends
>> AbstractLdapTestUnit
>>   assertNotNull( done );
>>   assertEquals( ResultCodeEnum.SUCCESS,
>> done.getLdapResult().getResultCode() );
>>   assertEquals( 1, entries.size() );
>> -    assertTrue( entries.contains( "cn=user784,dc=test,dc=com" ) );
>> +    assertTrue( entries.contains( "cn=user78,dc=test,dc=com" ) );
>>   cursor.close();
>>   }
>>   }
>> diff --git
>> a/server-integ/src/test/java/org/apache/directory/server/operations/bind/DelegatedAuthIT.java
>> b/server-integ/src/test/java/org/apache/directory/server/operations/bind/DelegatedAuthIT.java
>>
>> index 91f67ac..c43afcc 100644
>> ---
>> a/server-integ/src/test/java/org/apache/directory/server/operations/bind/DelegatedAuthIT.java
>>
>> +++
>> b/server-integ/src/test/java/org/apache/directory/server/operations/bind/DelegatedAuthIT.java
>>
>> @@ -26,7 +26,6 @@ import static org.junit.Assert.fail;
>>     import
>> org.apache.directory.api.ldap.model.exception.LdapAuthenticationException;
>>
>>   import org.apache.directory.api.util.Network;
>> -import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
>>   import org.apache.directory.ldap.client.api.LdapConnection;
>>   import org.apache.directory.ldap.client.api.LdapNetworkConnection;
>>   import org.apache.directory.server.annotations.CreateLdapServer;
>> @@ -37,7 +36,6 @@ import
>> org.apache.directory.server.core.annotations.CreateDS;
>>   import org.apache.directory.server.core.authn.DelegatingAuthenticator;
>>   import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
>>   import org.apache.directory.server.core.integ.FrameworkRunner;
>> -import org.junit.Rule;
>>   import org.junit.Test;
>>   import org.junit.runner.RunWith;
>>   @@ -77,9 +75,6 @@ import org.junit.runner.RunWith;
>>   public class DelegatedAuthIT extends AbstractLdapTestUnit
>>   {
>>   -    @Rule
>> -    public MultiThreadedMultiInvoker i = new
>> MultiThreadedMultiInvoker( 1, 1000 );
>> -
>>     /**
>>    * Test with bindDn which is not even found under any
>> namingContext of the
>> diff --git
>> a/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/DIRSERVER_1974_IT.java
>> b/server-integ/src/test/java/org/apach

Re: [directory-server] branch master updated: Speed up tests, reduce number of iterations

2019-07-09 Thread Emmanuel Lécharny



On 09/07/2019 17:03, Stefan Seelmann wrote:

Ok, reverted. Let's first see how tests on Jenkins look like, then
ignore if required.



Okie. We can also rename the class adding a 'Perf' at the end : it will 
then only be ran when you use the 'perf' profile.



Or maybe we should add a special profile for such test ?



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



Re: ApacheDS and API test issues

2019-07-09 Thread Emmanuel Lécharny

Another recurrent issue (although it does not happen frequently :


[ERROR] Failures:
[ERROR] 
ServerEntrySerializerTest.testSerializeServerEntryWithAttributeStringValue:272 
expected: org.apache.directory.api.ldap.model.entry.DefaultEntry
dn:
ObjectClass: person
but was: org.apache.directory.api.ldap.model.entry.DefaultEntry
Hi,

I see two types of test issues recently:

* DIRSERVER_1974_IT seems to take too long on slow machines (especially
Windows) and causes timeout. I'll investigate a bit further.

* ClientAddRequestTest sometimes hangs forever. I was able to reproduce
on my machine when running it multiple times. It waits forever for a
future, see thread dump below.

Kind Regards,
Stefan


"main" #1 prio=5 os_prio=0 tid=0x7fd6a400d800 nid=0x73ce in
Object.wait() [0x7fd6aa16e000]

java.lang.Thread.State: TIMED_WAITING (on object monitor)

 at java.lang.Object.wait(Native Method)


 - waiting on <0x0007794c4780> (a
org.apache.directory.ldap.client.api.future.AddFuture)

 at
org.apache.directory.ldap.client.api.future.UniqueResponseFuture.get(UniqueResponseFuture.java:90)


 - locked <0x0007794c4780> (a
org.apache.directory.ldap.client.api.future.AddFuture)
 at
org.apache.directory.ldap.client.api.LdapNetworkConnection.add(LdapNetworkConnection.java:1089)
 at
org.apache.directory.ldap.client.api.LdapNetworkConnection.add(LdapNetworkConnection.java:1021)
 at
org.apache.directory.shared.client.api.operations.ClientAddRequestTest.testAddNullValueSchemaAware(ClientAddRequestTest.java:417)




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



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