joshelser commented on a change in pull request #1057: HBASE-23701 Try to 
converge automated checks around Category
URL: https://github.com/apache/hbase/pull/1057#discussion_r368021245
 
 

 ##########
 File path: 
hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseClassTestRule.java
 ##########
 @@ -59,13 +59,20 @@ private HBaseClassTestRule(Class<?> clazz, Timeout 
timeout) {
 
   private static long getTimeoutInSeconds(Class<?> clazz) {
     Category[] categories = clazz.getAnnotationsByType(Category.class);
-    for (Class<?> c : categories[0].value()) {
-      if (c == SmallTests.class || c == MediumTests.class || c == 
LargeTests.class) {
-        // All tests have a 13 minutes timeout.
-        return TimeUnit.MINUTES.toSeconds(13);
-      }
-      if (c == IntegrationTests.class) {
-        return TimeUnit.MINUTES.toSeconds(Long.MAX_VALUE);
+    // This should never happen
+    if (categories.length > 1) {
+      throw new IllegalArgumentException("Code-bug: unsure how to handle more 
than one Category");
 
 Review comment:
   Yeah, my comment on Jira about there never being more than one was from me 
seeing this was not a Repeatable annotation. Thanks for linking the docs.
   
   I don't like the `Preconditions.checkArgument` though, as this is 
duplicating the same exception (a test category is not defined).

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to