use of alluxio.hub.agent.process.AgentProcessContext in project alluxio by Alluxio.
the class AgentRpcServerTest method testAwaitTermination.
@Test
public void testAwaitTermination() throws Exception {
AlluxioConfiguration conf = getTestSpecificTestConfig();
AgentProcessContext ctx = TestAgentProcessContextFactory.simpleContext(conf);
AgentRpcServer server = new AgentRpcServer(conf, ctx);
// shut down server once started.
Thread t = new Thread(server::close);
assertTrue(server.isServing());
t.start();
server.awaitTermination();
t.join();
assertFalse(server.isServing());
}
Aggregations