devmadhuu commented on code in PR #5614:
URL: https://github.com/apache/ozone/pull/5614#discussion_r1398677195
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/node/TestQueryNode.java:
##########
@@ -114,25 +117,32 @@ public void testHealthyNodesCount() throws Exception {
}
@Test
- @Timeout(10)
public void testStaleNodesCount() throws Exception {
- cluster.shutdownHddsDatanode(0);
- cluster.shutdownHddsDatanode(1);
-
- GenericTestUtils.waitFor(() ->
- cluster.getStorageContainerManager().getNodeCount(STALE) == 2,
- 100, 4 * 1000);
-
- int nodeCount = scmClient.queryNode(null, STALE,
- HddsProtos.QueryScope.CLUSTER, "").size();
- assertEquals(2, nodeCount, "Mismatch of expected nodes count");
+ CompletableFuture.runAsync(() -> {
+ cluster.shutdownHddsDatanode(0);
+ cluster.shutdownHddsDatanode(1);
+ }, executor);
Review Comment:
> Why does the executor have 2 threads when a single task shuts down both
nodes?
>
> Nit: can use `executor` directly, no need for `CompletableFuture`, since
we don't use it for checking the results.
>
> Also: `executor` can be local to this test case.
Yeah thanks for noticing. I realized that. I have made changes as per your
suggestion.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]