Skip to content
Permalink
Browse files

Dedicated port allocation for journaltool test

  • Loading branch information...
ggezer committed May 10, 2019
1 parent 68978dd commit 0dae9e505f2da168d2a6be2dc6de0a26b45d2470
@@ -68,6 +68,8 @@
public static final List<ReservedPort> MULTI_MASTER_URI = allocate(3, 1);
public static final List<ReservedPort> ZOOKEEPER_URI = allocate(3, 2);

public static final List<ReservedPort> JOURNAL_TOOL = allocate(2, 1);

private static synchronized List<ReservedPort> allocate(int numMasters, int numWorkers) {
int needed = numMasters * MultiProcessCluster.PORTS_PER_MASTER
+ numWorkers * MultiProcessCluster.PORTS_PER_WORKER;
@@ -33,12 +33,8 @@
import alluxio.testutils.IntegrationTestUtils;
import alluxio.util.io.PathUtils;

import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.Layout;
import org.apache.log4j.PatternLayout;
import org.hamcrest.Matchers;
import org.junit.After;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;

@@ -65,13 +61,6 @@

private final ByteArrayOutputStream mOutput = new ByteArrayOutputStream();

@BeforeClass
public static void beforeclass() {

Layout layout = new PatternLayout("%d [%t] %-5p %c %x - %m%n");
org.apache.log4j.Logger.getRootLogger().addAppender(new ConsoleAppender(layout));
}

@Rule
public SystemOutRule mSystemOutRule = new SystemOutRule(mOutput);

@@ -96,7 +85,7 @@ private void initializeCluster(Map<PropertyKey, String> props) throws Throwable
}
// Build and start a multi-process cluster.
mMultiProcessCluster = MultiProcessCluster
.newBuilder(PortCoordination.MULTI_PROCESS_SIMPLE_CLUSTER)
.newBuilder(PortCoordination.JOURNAL_TOOL)
.setNumMasters(MASTER_COUNT)
.setNumWorkers(WORKER_COUNT)
.addProperties(defaultProps)
@@ -111,7 +100,6 @@ private void initializeCluster(Map<PropertyKey, String> props) throws Throwable
@After
public void after() throws Throwable {
mMultiProcessCluster.destroy();
mMultiProcessCluster.stopZk();
}

@Test

0 comments on commit 0dae9e5

Please sign in to comment.
You can’t perform that action at this time.