You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2020/07/21 12:36:36 UTC

[GitHub] [hive] pgaref commented on a change in pull request #1277: HIVE-23855: TestQueryShutdownHooks is flaky

pgaref commented on a change in pull request #1277:
URL: https://github.com/apache/hive/pull/1277#discussion_r458061768



##########
File path: service/src/test/org/apache/hadoop/util/ShutdownHookManagerInspector.java
##########
@@ -20,9 +20,20 @@
 
 import java.util.List;
 
+import static org.junit.Assert.assertEquals;
+
 public class ShutdownHookManagerInspector {
 
-  public static List<ShutdownHookManager.HookEntry> getShutdownHooksInOrder() {
-    return ShutdownHookManager.get().getShutdownHooksInOrder();
+  public static int getShutdownHookCount() {
+    return ShutdownHookManager.get().getShutdownHooksInOrder().size();
+  }
+
+  public static void assertShutdownHookCount(int expected) {
+    List<ShutdownHookManager.HookEntry> entries = ShutdownHookManager.get().getShutdownHooksInOrder();
+    StringBuilder errorBuilder = new StringBuilder("Shutdown hooks:\n");
+    for (ShutdownHookManager.HookEntry entry: entries) {

Review comment:
       nit: space before col




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

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