YARN-10455. TestNMProxy.testNMProxyRPCRetry is not consistent. Contributed by Ahmed Hussein
(cherry picked from commit deb35a32ba
)
This commit is contained in:
parent
ecf91638a8
commit
4ef9cf9d71
|
@ -20,6 +20,7 @@ package org.apache.hadoop.yarn.server.nodemanager.containermanager;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.SocketException;
|
||||
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
import org.apache.hadoop.fs.CommonConfigurationKeysPublic;
|
||||
|
@ -28,6 +29,7 @@ import org.apache.hadoop.io.retry.UnreliableInterface;
|
|||
import org.apache.hadoop.security.SecurityUtil;
|
||||
import org.apache.hadoop.security.UserGroupInformation;
|
||||
import org.apache.hadoop.security.token.Token;
|
||||
import org.apache.hadoop.test.LambdaTestUtils;
|
||||
import org.apache.hadoop.yarn.api.ContainerManagementProtocol;
|
||||
import org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusesRequest;
|
||||
import org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusesResponse;
|
||||
|
@ -161,15 +163,10 @@ public class TestNMProxy extends BaseContainerManagerTest {
|
|||
IPC_CLIENT_CONNECT_MAX_RETRIES_ON_SOCKET_TIMEOUTS_KEY, 100);
|
||||
// connect to some dummy address so that it can trigger
|
||||
// connection failure and RPC level retires.
|
||||
newConf.set(YarnConfiguration.NM_ADDRESS, "0.0.0.0:1234");
|
||||
newConf.set(YarnConfiguration.NM_ADDRESS, "127.0.0.1:1");
|
||||
ContainerManagementProtocol proxy = getNMProxy(newConf);
|
||||
try {
|
||||
proxy.startContainers(allRequests);
|
||||
Assert.fail("should get socket exception");
|
||||
} catch (IOException e) {
|
||||
// socket exception should be thrown immediately, without RPC retries.
|
||||
Assert.assertTrue(e instanceof java.net.SocketException);
|
||||
}
|
||||
LambdaTestUtils.intercept(SocketException.class,
|
||||
() -> proxy.startContainers(allRequests));
|
||||
}
|
||||
|
||||
private ContainerManagementProtocol getNMProxy(Configuration conf) {
|
||||
|
|
Loading…
Reference in New Issue