ndimiduk commented on code in PR #5740:
URL: https://github.com/apache/hbase/pull/5740#discussion_r1512514489
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/AbstractTestIPC.java:
##########
@@ -570,19 +614,33 @@ public void testTracingErrorIpc() throws IOException {
protected abstract AbstractRpcClient<?> createBadAuthRpcClient(Configuration
conf);
+ private IOException doBadPreableHeaderCall(BlockingInterface stub) {
+ ServiceException se = assertThrows(ServiceException.class,
+ () -> stub.echo(null,
EchoRequestProto.newBuilder().setMessage("hello").build()));
+ return ProtobufUtil.handleRemoteException(se);
+ }
+
@Test
- public void testBadPreambleHeader() throws IOException, ServiceException {
+ public void testBadPreambleHeader() throws Exception {
Configuration clientConf = new Configuration(CONF);
RpcServer rpcServer = createRpcServer("testRpcServer",
Collections.emptyList(),
new InetSocketAddress("localhost", 0), CONF, new FifoRpcScheduler(CONF,
1));
try (AbstractRpcClient<?> client = createBadAuthRpcClient(clientConf)) {
rpcServer.start();
BlockingInterface stub = newBlockingStub(client,
rpcServer.getListenerAddress());
- ServiceException se = assertThrows(ServiceException.class,
- () -> stub.echo(null,
EchoRequestProto.newBuilder().setMessage("hello").build()));
- IOException ioe = ProtobufUtil.handleRemoteException(se);
- assertThat(ioe, instanceOf(BadAuthException.class));
- assertThat(ioe.getMessage(), containsString("authName=unknown"));
+ BadAuthException error = null;
+ // for SimpleRpcServer, it is possible that we get a broken pipe before
getting the
+ // BadAuthException, so we add some retries here, see HBASE-28417
+ for (int i = 0; i < 10; i++) {
Review Comment:
Haha, same request as I received from @NihalJain -- can this use Waiter
instead?
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/AbstractTestIPC.java:
##########
@@ -114,14 +118,12 @@ public abstract class AbstractTestIPC {
private static final KeyValue CELL = new KeyValue(CELL_BYTES, CELL_BYTES,
CELL_BYTES, CELL_BYTES);
protected static final Configuration CONF = HBaseConfiguration.create();
Review Comment:
Can you get rid of this static CONF instance entirely. All of its accesses
in this class are using it with a copy constructor, but TestNettyTlsIPC is
using/modifying it directly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]