Search in sources :

Example 1 with ManagerProcess

use of alluxio.hub.manager.process.ManagerProcess in project alluxio by Alluxio.

the class AgentProcessMonitorTest method testProcessMonitorSuccess.

@Test
public void testProcessMonitorSuccess() throws Exception {
    InstancedConfiguration c = getTestConfig();
    mTempDir.newFolder("bin");
    mTempDir.newFile("bin/alluxio-start.sh");
    c.set(PropertyKey.HOME, mTempDir.getRoot().getAbsolutePath());
    try (ManagerProcess mProc = new ManagerProcess(c)) {
        InstancedConfiguration agentConf = new InstancedConfiguration(c.copyProperties());
        agentConf.set(PropertyKey.HUB_MANAGER_RPC_PORT, mProc.getRpcPort());
        try (AgentProcess proc = new AgentProcess(agentConf)) {
            CountingRetry cntRetry = new CountingRetry(5);
            AgentProcessMonitor.pingService(new InetSocketAddress("127.0.0.1", proc.getRpcPort()), cntRetry, 200);
        }
    } catch (Exception e) {
        fail("Should not have thrown an exception: " + e);
    }
}
Also used : InstancedConfiguration(alluxio.conf.InstancedConfiguration) CountingRetry(alluxio.retry.CountingRetry) InetSocketAddress(java.net.InetSocketAddress) ManagerProcess(alluxio.hub.manager.process.ManagerProcess) Test(org.junit.Test) BaseHubTest(alluxio.hub.test.BaseHubTest)

Aggregations

InstancedConfiguration (alluxio.conf.InstancedConfiguration)1 ManagerProcess (alluxio.hub.manager.process.ManagerProcess)1 BaseHubTest (alluxio.hub.test.BaseHubTest)1 CountingRetry (alluxio.retry.CountingRetry)1 InetSocketAddress (java.net.InetSocketAddress)1 Test (org.junit.Test)1