diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/MetadataServerConnectionsIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MetadataServerConnectionsIT.java index bebabc9bbfd..30084c336fd 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/MetadataServerConnectionsIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/MetadataServerConnectionsIT.java @@ -161,9 +161,9 @@ public void createTable(RpcController controller, MetaDataProtos.CreateTableRequ int count = Thread.activeCount(); Thread[] th = new Thread[count]; // returns the number of threads put into the array - Thread.enumerate(th); + int n = Thread.enumerate(th); long hTablePoolCount = - Arrays.stream(th).filter(s -> s.getName().equals("htable-pool-0")).count(); + Arrays.stream(th, 0, n).filter(s -> s.getName().equals("htable-pool-0")).count(); // Assert no default HTable threadpools are created. assertEquals(0, hTablePoolCount); LOGGER.debug("htable-pool-0 threads {}", hTablePoolCount);