You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "abstractdog (via GitHub)" <gi...@apache.org> on 2023/03/04 08:40:24 UTC

[GitHub] [hive] abstractdog commented on a diff in pull request #4096: HIVE-27117: Fix compaction related flaky tests

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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org