Skip to content

Commit

Permalink
BOOKKEEPER-522: TestHedwigHub is failing silently on Jenkins (ivank v…
Browse files Browse the repository at this point in the history
…ia sijie)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/bookkeeper/trunk@1425586 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
sijie committed Dec 24, 2012
1 parent fa13426 commit a0ae97c
Show file tree
Hide file tree
Showing 15 changed files with 192 additions and 66 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ Trunk (unreleased changes)


BOOKKEEPER-342: add documentation for hedwig metadata manager interface. (sijie, ivank via sijie) BOOKKEEPER-342: add documentation for hedwig metadata manager interface. (sijie, ivank via sijie)


BOOKKEEPER-522: TestHedwigHub is failing silently on Jenkins (ivank via sijie)

hedwig-client: hedwig-client:


BOOKKEEPER-306: Change C++ client to use gtest for testing (ivank via sijie) BOOKKEEPER-306: Change C++ client to use gtest for testing (ivank via sijie)
Expand Down
2 changes: 0 additions & 2 deletions bookkeeper-benchmark/pom.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.9</version>
<configuration> <configuration>
<argLine>-Xmx1G -Djava.net.preferIPv4Stack=true</argLine>
<systemPropertyVariables> <systemPropertyVariables>
<test.latency.file>target/latencyDump.dat</test.latency.file> <test.latency.file>target/latencyDump.dat</test.latency.file>
</systemPropertyVariables> </systemPropertyVariables>
Expand Down
9 changes: 0 additions & 9 deletions bookkeeper-server/pom.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -153,15 +153,6 @@
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.9</version>
<configuration>
<argLine>-Xmx1G -Djava.net.preferIPv4Stack=true</argLine>
<forkMode>pertest</forkMode>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
Expand Down
2 changes: 0 additions & 2 deletions hedwig-server/pom.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -233,9 +233,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.9</version>
<configuration> <configuration>
<argLine>-Xmx1G -Djava.net.preferIPv4Stack=true</argLine>
<systemPropertyVariables> <systemPropertyVariables>
<derby.stream.error.file>target/derby.log</derby.stream.error.file> <derby.stream.error.file>target/derby.log</derby.stream.error.file>
<build.test.dir>target/zk_clientbase_build</build.test.dir> <build.test.dir>target/zk_clientbase_build</build.test.dir>
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ protected void startHubServers() throws Exception {
for (int i = 0; i < numServers; i++) { for (int i = 0; i < numServers; i++) {
ServerConfiguration conf = getServerConfiguration(serverAddresses.get(i).getPort(), ServerConfiguration conf = getServerConfiguration(serverAddresses.get(i).getPort(),
serverAddresses.get(i).getSSLPort()); serverAddresses.get(i).getSSLPort());
PubSubServer s = new PubSubServer(conf); PubSubServer s = new PubSubServer(conf, new ClientConfiguration(), new LoggingExceptionHandler());
serversList.add(s); serversList.add(s);
s.start(); s.start();
} }
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.apache.hedwig.server.netty.PubSubServer; import org.apache.hedwig.server.netty.PubSubServer;
import org.apache.hedwig.server.persistence.BookKeeperTestBase; import org.apache.hedwig.server.persistence.BookKeeperTestBase;
import org.apache.hedwig.util.HedwigSocketAddress; import org.apache.hedwig.util.HedwigSocketAddress;
import org.apache.hedwig.server.LoggingExceptionHandler;


import org.apache.bookkeeper.test.PortManager; import org.apache.bookkeeper.test.PortManager;


Expand Down Expand Up @@ -269,7 +270,8 @@ protected void startRegion(int i) throws Exception {
getServerConfiguration(a.getPort(), getServerConfiguration(a.getPort(),
a.getSSLPort(), a.getSSLPort(),
regionName), regionName),
getRegionClientConfiguration()); getRegionClientConfiguration(),
new LoggingExceptionHandler());
serversList.add(s); serversList.add(s);
s.start(); s.start();
} }
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hedwig.server;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Exception handler that simply logs the exception and
* does nothing more. To be used in tests instead of TerminateJVMExceptionHandler
*/
public class LoggingExceptionHandler implements Thread.UncaughtExceptionHandler {
static Logger logger = LoggerFactory.getLogger(LoggingExceptionHandler.class);

@Override
public void uncaughtException(Thread t, Throwable e) {
logger.error("Uncaught exception in thread " + t.getName(), e);
}

}
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@


import org.apache.bookkeeper.test.PortManager; import org.apache.bookkeeper.test.PortManager;


import org.apache.hedwig.client.conf.ClientConfiguration;
import org.apache.hedwig.server.LoggingExceptionHandler;
import org.apache.hedwig.server.common.ServerConfiguration; import org.apache.hedwig.server.common.ServerConfiguration;
import org.apache.hedwig.server.netty.PubSubServer; import org.apache.hedwig.server.netty.PubSubServer;
import org.apache.hedwig.util.HedwigSocketAddress; import org.apache.hedwig.util.HedwigSocketAddress;
Expand Down Expand Up @@ -95,7 +97,7 @@ protected HedwigSocketAddress getDefaultHedwigAddress() {
protected void startHubServer(ServerConfiguration conf) throws Exception { protected void startHubServer(ServerConfiguration conf) throws Exception {
defaultAddress = new HedwigSocketAddress("localhost", conf.getServerPort(), defaultAddress = new HedwigSocketAddress("localhost", conf.getServerPort(),
conf.getSSLServerPort()); conf.getSSLServerPort());
server = new PubSubServer(conf); server = new PubSubServer(conf, new ClientConfiguration(), new LoggingExceptionHandler());
server.start(); server.start();
} }


Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@


import junit.framework.Assert; import junit.framework.Assert;


import org.apache.hedwig.client.conf.ClientConfiguration;
import org.apache.hedwig.server.LoggingExceptionHandler;
import org.apache.bookkeeper.test.PortManager; import org.apache.bookkeeper.test.PortManager;
import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.configuration.ConfigurationException;
import org.apache.hedwig.server.common.ServerConfiguration; import org.apache.hedwig.server.common.ServerConfiguration;
Expand Down Expand Up @@ -102,7 +104,7 @@ private void instantiateAndDestroyPubSubServer() throws IOException, Interrupted
PubSubServer hedwigServer = null; PubSubServer hedwigServer = null;
try { try {
logger.info("starting hedwig broker!"); logger.info("starting hedwig broker!");
hedwigServer = new PubSubServer(serverConf); hedwigServer = new PubSubServer(serverConf, new ClientConfiguration(), new LoggingExceptionHandler());
hedwigServer.start(); hedwigServer.start();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
Expand Down
Loading

0 comments on commit a0ae97c

Please sign in to comment.