Search in sources :

Example 1 with ConfigurationBuilder

use of alluxio.conf.ConfigurationBuilder in project alluxio by Alluxio.

the class PollingMasterInquireClientTest method pollRejectingDoesntHang.

@Test(timeout = 10000)
public void pollRejectingDoesntHang() throws Exception {
    int port = mPort.getPort();
    InetSocketAddress serverAddress = new InetSocketAddress("127.0.0.1", port);
    RejectingServer s = new RejectingServer(serverAddress);
    s.start();
    List<InetSocketAddress> addrs = Arrays.asList(InetSocketAddress.createUnresolved(NetworkAddressUtils.getLocalHostName(Constants.SECOND_MS), port));
    PollingMasterInquireClient client = new PollingMasterInquireClient(addrs, () -> new CountingRetry(0), new ConfigurationBuilder().build());
    try {
        client.getPrimaryRpcAddress();
        fail("Expected polling to fail");
    } catch (UnavailableException e) {
    // Expected
    }
}
Also used : ConfigurationBuilder(alluxio.conf.ConfigurationBuilder) CountingRetry(alluxio.retry.CountingRetry) RejectingServer(alluxio.network.RejectingServer) InetSocketAddress(java.net.InetSocketAddress) UnavailableException(alluxio.exception.status.UnavailableException) Test(org.junit.Test)

Aggregations

ConfigurationBuilder (alluxio.conf.ConfigurationBuilder)1 UnavailableException (alluxio.exception.status.UnavailableException)1 RejectingServer (alluxio.network.RejectingServer)1 CountingRetry (alluxio.retry.CountingRetry)1 InetSocketAddress (java.net.InetSocketAddress)1 Test (org.junit.Test)1