deniskuzZ commented on code in PR #6132:
URL: https://github.com/apache/hive/pull/6132#discussion_r2440059991


##########
ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestInitiator.java:
##########
@@ -90,17 +90,8 @@ public void recoverFailedLocalWorkers() throws Exception {
     ShowCompactResponse rsp = txnHandler.showCompact(new ShowCompactRequest());
     List<ShowCompactResponseElement> compacts = rsp.getCompacts();
     Assert.assertEquals(2, compacts.size());
-    boolean sawInitiated = false;
-    for (ShowCompactResponseElement c : compacts) {
-      if (c.getState().equals("working")) {
-        Assert.assertEquals("nosuchhost-193892", c.getWorkerid());
-      } else if (c.getState().equals("initiated")) {
-        sawInitiated = true;
-      } else {
-        Assert.fail("Unexpected state");
-      }
-    }
-    Assert.assertTrue(sawInitiated);
+    Assert.assertEquals("working", compacts.get(0).getState());

Review Comment:
   ````
   newTable("default", "rflw1", false);
   CompactionRequest rqst = new CompactionRequest("default", "rflw1", 
CompactionType.MINOR);
   txnHandler.compact(rqst);
   
   newTable("default", "rflw2", false);
   rqst = new CompactionRequest("default", "rflw2", CompactionType.MINOR);
   txnHandler.compact(rqst);
   
   txnHandler.findNextToCompact(aFindNextCompactRequest(ServerUtils.hostname() 
+ "-193892", "4.0.0"));
   txnHandler.findNextToCompact(aFindNextCompactRequest("nosuchhost-193892", 
"4.0.0"));
   
   ShowCompactResponse rsp = txnHandler.showCompact(new ShowCompactRequest());
   rsp.getCompacts().forEach(ce ->
       Assert.assertEquals("working", ce.getState()));
   
   conf.setTimeVar(HiveConf.ConfVars.HIVE_COMPACTOR_WORKER_TIMEOUT, 1L, 
TimeUnit.MILLISECONDS);
   startInitiator();
   
   rsp = txnHandler.showCompact(new ShowCompactRequest());
   rsp.getCompacts().forEach(ce ->
       Assert.assertEquals("initiated", ce.getState()));
   ````
   maybe squash both tests in 1 remove and local



-- 
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]

Reply via email to