Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding a specific mini test that exercises ServerTestUtils.startVolde…

…mortServer. This ~15 line program that simply starts some Voldemort servers using test utils can tickle two different intermittent failures:

(1) ObsoleteVersionException when loading cluster.xml

Testcase: startMultipleVoldemortServers took 0.385 sec
	Caused an ERROR
A successor version version()  to this version() exists for key cluster.xml
voldemort.versioning.ObsoleteVersionException: A successor version version()  to this version() exists for key cluster.xml

and

(2) A bind issue characterized as follows:

Testcase: startMultipleVoldemortServers took 2.066 sec
        Caused an ERROR
java.net.BindException: Address already in use
voldemort.VoldemortException: java.net.BindException: Address already in use
	at voldemort.server.niosocket.NioSocketService.startInner(NioSocketService.java:131)
	at voldemort.server.AbstractService.start(AbstractService.java:62)
	at voldemort.server.VoldemortServer.startInner(VoldemortServer.java:255)
	at voldemort.server.AbstractService.start(AbstractService.java:62)
	at voldemort.ServerTestUtils.startVoldemortServer(ServerTestUtils.java:666)
	at voldemort.utils.ServerTestUtilsTest.setUp(ServerTestUtilsTest.java:50)
Caused by: java.net.BindException: Address already in use
	at sun.nio.ch.Net.bind(Native Method)
	at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:126)
	at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
	at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:52)
	at voldemort.server.niosocket.NioSocketService.startInner(NioSocketService.java:125)
  • Loading branch information...
commit 03c60cee4dbccf7d49e6ca44bd278fc64350a546 1 parent d685b67
@jayjwylie jayjwylie authored
Showing with 72 additions and 0 deletions.
  1. +72 −0 test/unit/voldemort/utils/ServerTestUtilsTest.java
View
72 test/unit/voldemort/utils/ServerTestUtilsTest.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2008-2009 LinkedIn, Inc
+ *
+ * Licensed 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 voldemort.utils;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.Properties;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import voldemort.ServerTestUtils;
+import voldemort.TestUtils;
+import voldemort.cluster.Cluster;
+import voldemort.server.VoldemortServer;
+import voldemort.store.socket.SocketStoreFactory;
+import voldemort.store.socket.clientrequest.ClientRequestExecutorPool;
+
+public class ServerTestUtilsTest {
+
+ // private static String storesXmlfile = "test/common/voldemort/config/single-store.xml";
+ private static String storesXmlfile = "test/common/voldemort/config/stores.xml";
+ private SocketStoreFactory socketStoreFactory = new ClientRequestExecutorPool(2,
+ 10000,
+ 100000,
+ 32 * 1024);
+
+ @Before
+ public void setUp() throws IOException {
+ /*-
+ Cluster cluster = ServerTestUtils.getLocalCluster(1, new int[][] { { 0, 1, 2, 3, 4, 5, 6,
+ 7, 8 } });
+ */
+ Cluster cluster = ServerTestUtils.getLocalCluster(8, new int[][] { { 0 }, { 1 }, { 2 },
+ { 3 }, { 4 }, { 5 }, { 6 }, { 7 } });
+
+ VoldemortServer[] servers = new VoldemortServer[8];
+
+ // for(int i = 0; i < 1; i++) {
+ for(int i = 0; i < 8; i++) {
+ servers[i] = ServerTestUtils.startVoldemortServer(socketStoreFactory,
+ ServerTestUtils.createServerConfig(true,
+ i,
+ TestUtils.createTempDir()
+ .getAbsolutePath(),
+ null,
+ storesXmlfile,
+ new Properties()),
+ cluster);
+ }
+ }
+
+ @Test
+ public void startMultipleVoldemortServers() {
+ assertTrue(true);
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.