Hi, there were some test failures in replication tests. I "fixed" them by registering the replication controls manully, see below. But I'm not sure if that's the right way, or if the controls should be registered automatically? Seems before it was not necessary to register them manually.
Kind Regards, Stefan On 12/24/18 1:19 AM, [email protected] 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 a967693 Fix replication tests > a967693 is described below > > commit a967693c3458a1bc5d8bb052cf54499ee9eeb189 > Author: Stefan Seelmann <[email protected]> > AuthorDate: Mon Dec 24 01:18:53 2018 +0100 > > Fix replication tests > --- > .../server/replication/ClientServerReplicationIT.java | 10 > ++++++++++ > .../directory/server/replication/MockSyncReplConsumer.java | 2 +- > .../directory/server/replication/StaleEventLogDetectionIT.java | 10 > ++++++++++ > 3 files changed, 21 insertions(+), 1 deletion(-) > > diff --git > a/server-integ/src/test/java/org/apache/directory/server/replication/ClientServerReplicationIT.java > > b/server-integ/src/test/java/org/apache/directory/server/replication/ClientServerReplicationIT.java > index bedb02c..ebec5bb 100644 > --- > a/server-integ/src/test/java/org/apache/directory/server/replication/ClientServerReplicationIT.java > +++ > b/server-integ/src/test/java/org/apache/directory/server/replication/ClientServerReplicationIT.java > @@ -30,6 +30,10 @@ import java.util.List; > import java.util.concurrent.CountDownLatch; > import java.util.concurrent.atomic.AtomicInteger; > > +import org.apache.directory.api.ldap.codec.api.LdapApiService; > +import > org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory; > +import > org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory; > +import > org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory; > import org.apache.directory.api.ldap.model.constants.SchemaConstants; > import org.apache.directory.api.ldap.model.csn.Csn; > import org.apache.directory.api.ldap.model.cursor.Cursor; > @@ -558,6 +562,12 @@ public class ClientServerReplicationIT > { > DirectoryService provDirService = > DSAnnotationProcessor.getDirectoryService(); > > + // Load the replication controls > + LdapApiService codec = provDirService.getLdapCodecService(); > + codec.registerRequestControl( new SyncRequestValueFactory( codec ) ); > + codec.registerResponseControl( new SyncDoneValueFactory( codec ) ); > + codec.registerResponseControl( new SyncStateValueFactory( codec ) ); > + > providerServer = ServerAnnotationProcessor.getLdapServer( > provDirService ); > providerServer.setReplicationReqHandler( new > SyncReplRequestHandler() ); > providerServer.startReplicationProducer(); > diff --git > a/server-integ/src/test/java/org/apache/directory/server/replication/MockSyncReplConsumer.java > > b/server-integ/src/test/java/org/apache/directory/server/replication/MockSyncReplConsumer.java > index 5e43043..53253c2 100644 > --- > a/server-integ/src/test/java/org/apache/directory/server/replication/MockSyncReplConsumer.java > +++ > b/server-integ/src/test/java/org/apache/directory/server/replication/MockSyncReplConsumer.java > @@ -222,7 +222,7 @@ public class MockSyncReplConsumer implements > ConnectionClosedEventListener, Repl > if ( connection == null ) > { > connection = new LdapNetworkConnection( providerHost, port ); > - connection.setTimeOut( -1L ); > + connection.setTimeOut( 10000L ); > > if ( config.isUseTls() ) > { > diff --git > a/server-integ/src/test/java/org/apache/directory/server/replication/StaleEventLogDetectionIT.java > > b/server-integ/src/test/java/org/apache/directory/server/replication/StaleEventLogDetectionIT.java > index 0542225..57dd032 100644 > --- > a/server-integ/src/test/java/org/apache/directory/server/replication/StaleEventLogDetectionIT.java > +++ > b/server-integ/src/test/java/org/apache/directory/server/replication/StaleEventLogDetectionIT.java > @@ -29,6 +29,10 @@ import java.io.IOException; > import java.util.concurrent.atomic.AtomicInteger; > > import org.apache.directory.api.util.FileUtils; > +import org.apache.directory.api.ldap.codec.api.LdapApiService; > +import > org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory; > +import > org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory; > +import > org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory; > import org.apache.directory.api.ldap.model.entry.DefaultEntry; > import org.apache.directory.api.ldap.model.entry.Entry; > import org.apache.directory.api.ldap.model.message.SearchRequest; > @@ -162,6 +166,12 @@ public class StaleEventLogDetectionIT > > providerServer = ServerAnnotationProcessor.getLdapServer( > provDirService ); > > + // Load the replication controls > + LdapApiService codec = provDirService.getLdapCodecService(); > + codec.registerRequestControl( new SyncRequestValueFactory( codec ) ); > + codec.registerResponseControl( new SyncDoneValueFactory( codec ) ); > + codec.registerResponseControl( new SyncStateValueFactory( codec ) ); > + > providerServer.setReplicationReqHandler( new > SyncReplRequestHandler() ); > providerServer.startReplicationProducer(); > >
