abstractdog commented on code in PR #4096:
URL: https://github.com/apache/hive/pull/4096#discussion_r1125420448


##########
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/txn/compactor/CompactorOnTezTest.java:
##########
@@ -185,23 +187,32 @@ protected void verifySuccessfulCompaction(int 
expectedSuccessfulCompactions) thr
   }
 
   protected HiveHookEvents.HiveHookEventProto getRelatedTezEvent(String 
dbTableName) throws Exception {
-    List<ProtoMessageReader<HiveHookEvents.HiveHookEventProto>> readers = 
TestHiveProtoLoggingHook.getTestReader(conf, tmpFolder);
-    for (ProtoMessageReader<HiveHookEvents.HiveHookEventProto> reader : 
readers) {
-      HiveHookEvents.HiveHookEventProto event = reader.readEvent();
-      boolean getRelatedEvent = false;
-      while (!getRelatedEvent) {
-        while (event != null && ExecutionMode.TEZ != 
ExecutionMode.valueOf(event.getExecutionMode())) {
-          event = reader.readEvent();
+    int retryCount = 3;
+    while (retryCount-- > 0) {
+      try {
+        List<ProtoMessageReader<HiveHookEvents.HiveHookEventProto>> readers = 
TestHiveProtoLoggingHook.getTestReader(conf, tmpFolder);

Review Comment:
   is it possible to write a countdownlatch magic here similarly to the fix in 
TestTxnCommands2



##########
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/txn/compactor/CompactorOnTezTest.java:
##########
@@ -185,23 +187,32 @@ protected void verifySuccessfulCompaction(int 
expectedSuccessfulCompactions) thr
   }
 
   protected HiveHookEvents.HiveHookEventProto getRelatedTezEvent(String 
dbTableName) throws Exception {
-    List<ProtoMessageReader<HiveHookEvents.HiveHookEventProto>> readers = 
TestHiveProtoLoggingHook.getTestReader(conf, tmpFolder);
-    for (ProtoMessageReader<HiveHookEvents.HiveHookEventProto> reader : 
readers) {
-      HiveHookEvents.HiveHookEventProto event = reader.readEvent();
-      boolean getRelatedEvent = false;
-      while (!getRelatedEvent) {
-        while (event != null && ExecutionMode.TEZ != 
ExecutionMode.valueOf(event.getExecutionMode())) {
-          event = reader.readEvent();
+    int retryCount = 3;
+    while (retryCount-- > 0) {
+      try {
+        List<ProtoMessageReader<HiveHookEvents.HiveHookEventProto>> readers = 
TestHiveProtoLoggingHook.getTestReader(conf, tmpFolder);

Review Comment:
   is it possible to write a countdownlatch magic here similarly to the fix in 
TestTxnCommands2?



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