Permalink
Browse files

BOOKKEEPER-522: TestHedwigHub is failing silently on Jenkins (ivank v…

…ia sijie)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/bookkeeper/trunk@1425586 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent fa13426 commit a0ae97c232caafa1fda9955f9aaa9f99564b74fe @sijie sijie committed Dec 24, 2012
View
@@ -316,6 +316,8 @@ Trunk (unreleased changes)
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:
BOOKKEEPER-306: Change C++ client to use gtest for testing (ivank via sijie)
@@ -43,9 +43,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.9</version>
<configuration>
- <argLine>-Xmx1G -Djava.net.preferIPv4Stack=true</argLine>
<systemPropertyVariables>
<test.latency.file>target/latencyDump.dat</test.latency.file>
</systemPropertyVariables>
@@ -155,15 +155,6 @@
<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>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
<executions>
@@ -233,9 +233,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.9</version>
<configuration>
- <argLine>-Xmx1G -Djava.net.preferIPv4Stack=true</argLine>
<systemPropertyVariables>
<derby.stream.error.file>target/derby.log</derby.stream.error.file>
<build.test.dir>target/zk_clientbase_build</build.test.dir>
@@ -137,7 +137,7 @@ protected void startHubServers() throws Exception {
for (int i = 0; i < numServers; i++) {
ServerConfiguration conf = getServerConfiguration(serverAddresses.get(i).getPort(),
serverAddresses.get(i).getSSLPort());
- PubSubServer s = new PubSubServer(conf);
+ PubSubServer s = new PubSubServer(conf, new ClientConfiguration(), new LoggingExceptionHandler());
serversList.add(s);
s.start();
}
@@ -35,6 +35,7 @@
import org.apache.hedwig.server.netty.PubSubServer;
import org.apache.hedwig.server.persistence.BookKeeperTestBase;
import org.apache.hedwig.util.HedwigSocketAddress;
+import org.apache.hedwig.server.LoggingExceptionHandler;
import org.apache.bookkeeper.test.PortManager;
@@ -269,7 +270,8 @@ protected void startRegion(int i) throws Exception {
getServerConfiguration(a.getPort(),
a.getSSLPort(),
regionName),
- getRegionClientConfiguration());
+ getRegionClientConfiguration(),
+ new LoggingExceptionHandler());
serversList.add(s);
s.start();
}
@@ -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);
+ }
+
+}
@@ -26,6 +26,8 @@
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.netty.PubSubServer;
import org.apache.hedwig.util.HedwigSocketAddress;
@@ -95,7 +97,7 @@ protected HedwigSocketAddress getDefaultHedwigAddress() {
protected void startHubServer(ServerConfiguration conf) throws Exception {
defaultAddress = new HedwigSocketAddress("localhost", conf.getServerPort(),
conf.getSSLServerPort());
- server = new PubSubServer(conf);
+ server = new PubSubServer(conf, new ClientConfiguration(), new LoggingExceptionHandler());
server.start();
}
@@ -25,6 +25,8 @@
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.commons.configuration.ConfigurationException;
import org.apache.hedwig.server.common.ServerConfiguration;
@@ -102,7 +104,7 @@ private void instantiateAndDestroyPubSubServer() throws IOException, Interrupted
PubSubServer hedwigServer = null;
try {
logger.info("starting hedwig broker!");
- hedwigServer = new PubSubServer(serverConf);
+ hedwigServer = new PubSubServer(serverConf, new ClientConfiguration(), new LoggingExceptionHandler());
hedwigServer.start();
} catch (Exception e) {
e.printStackTrace();
Oops, something went wrong.

0 comments on commit a0ae97c

Please sign in to comment.