deniskuzZ commented on code in PR #3489:
URL: https://github.com/apache/hive/pull/3489#discussion_r934500869
##########
ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestWorker.java:
##########
@@ -1026,6 +1029,38 @@ public void testFindNextCompactThrowsTException() throws
Exception {
verify(msc, times(0)).markFailed(any());
}
+ @Test
+ public void testDoesntGatherStatsIfCompactionFails() throws Exception {
+ try (
+ MockedStatic<Worker.StatsUpdater> statsUpdater =
Mockito.mockStatic(Worker.StatsUpdater.class)) {
+
+ Table t = newTable("default", "mtwb", false);
+
+ addBaseFile(t, null, 20L, 20);
+ addDeltaFile(t, null, 21L, 22L, 2);
+ addDeltaFile(t, null, 23L, 24L, 2);
+
+ burnThroughTransactions("default", "mtwb", 25);
+
+ CompactionRequest rqst = new CompactionRequest("default", "mtwb",
CompactionType.MINOR);
+ String initiatorVersion = "INITIATOR_VERSION";
+ rqst.setInitiatorVersion(initiatorVersion);
+ txnHandler.compact(rqst);
+
+ Worker worker = Mockito.spy(new Worker());
+
+ doThrow(new RuntimeException()).when(worker).getMrCompactor();
+
+ worker.setConf(conf);
+ String workerVersion = "WORKER_VERSION";
+ doReturn(workerVersion).when(worker).getRuntimeVersion();
Review Comment:
no need to set the worker version, init should be enough.
--
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]