From issues-return-332839-archive-asf-public=cust-asf.ponee.io@hbase.apache.org Wed Feb 7 07:54:05 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 52B8E18065B for ; Wed, 7 Feb 2018 07:54:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 424C3160C5B; Wed, 7 Feb 2018 06:54:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 85E28160C3C for ; Wed, 7 Feb 2018 07:54:04 +0100 (CET) Received: (qmail 86031 invoked by uid 500); 7 Feb 2018 06:54:03 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 86020 invoked by uid 99); 7 Feb 2018 06:54:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Feb 2018 06:54:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id F17DEC2D39 for ; Wed, 7 Feb 2018 06:54:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id p8GlTyITzwYb for ; Wed, 7 Feb 2018 06:54:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 237045F17E for ; Wed, 7 Feb 2018 06:54:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 4D4C4E01AB for ; Wed, 7 Feb 2018 06:54:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 0C89A21E84 for ; Wed, 7 Feb 2018 06:54:00 +0000 (UTC) Date: Wed, 7 Feb 2018 06:54:00 +0000 (UTC) From: "stack (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HBASE-19948) Since HBASE-19873, HBaseClassTestRule, Small/Medium/Large has different semantic MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-19948?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] stack updated HBASE-19948: -------------------------- Attachment: HBASE-19948.branch-2.001.patch > Since HBASE-19873, HBaseClassTestRule, Small/Medium/Large has different semantic > -------------------------------------------------------------------------------- > > Key: HBASE-19948 > URL: https://issues.apache.org/jira/browse/HBASE-19948 > Project: HBase > Issue Type: Bug > Reporter: stack > Assignee: stack > Priority: Major > Fix For: 2.0.0-beta-2 > > Attachments: HBASE-19948.branch-2.001.patch > > > I was confused on how SmallTest/MediumTest/LargeTest were being interpreted since HBASE-19873 where we added HBaseClassTestRule enforcing a ClassRule. > Small/Medium/Large are defined up in the refguide here: http://hbase.apache.org/book.html#hbase.unittests > E.g: "Small test cases are executed in a shared JVM and individual test cases should run in 15 seconds or less..." > I've always read the above as each method in a test suite/class should take 15 seconds (see below for finding by [~appy] [1]). > The old CategoryBasedTimeout annotation used to try and enforce a test method taking only its designated category amount of time. > The JUnit Timeout Rule talks about enforcing the timeout per test method: https://junit.org/junit4/javadoc/4.12/org/junit/rules/Timeout.html > The above meant that you could have as many tests as you wanted in a class/suite and it could run as along as you liked as along as each individual test stayed within its category-based elapsed amount of time (and the whole suite completed inside the surefire fork timeout of 15mins). > Then came HBASE-19873 which addressed an awkward issue around accounting for time spent in startup/shutdown -- i.e. time taken outside of a test method run -- and trying to have a timeout that cuts in before the surefire fork one does. It ended up adding a ClassRule that set a timeout on the whole test *suite/class* -- Good -- but the timeout set varies dependent upon the test category. A suite/class with 60 small tests that each take a second to complete now times out if you add one more test to the suite (61 seconds > 60 seconds timeout -- give or take vagaries of the platform you run the test on). > This latter change I have trouble with. It changes how small/medium/large have classically been understood. I think it will confuse too as now devs must do careful counting of test methods per class; one fat one (i.e. 'large') is same as N small ones. Could we set a single timeout on the whole test suite/class, one that was well less than the surefire fork kill timeout of 900seconds but keep the old timeout on each method as we used to have with the category-based annotation? > (Am just looking for agreement that we have a problem here and that we want categories to be per test method as it used be; how to do it doesn't look easy and is for later). > 1. @appy pointed out that the actual SmallTest annotation says something other than what is in the refguide: "Tag a test as 'small', meaning that the test class has the following characteristics: ....ideally, last less than 15 seconds...." https://github.com/apache/hbase/blob/master/hbase-annotations/src/test/java/org/apache/hadoop/hbase/testclassification/SmallTests.java#L22 > 2. Here is code to show how timeout has changed now... previous the below would have 'run' without timing out. > @Category({SmallTests.class}) > public class TestTimingOut { > @ClassRule > public static final HBaseClassTestRule CLASS_RULE = > HBaseClassTestRule.forClass(TestTimingOut.class); > @Test > public void oneTest() { > Threads.sleep(14000); > } > @Test > public void twoTest() { > Threads.sleep(14000); > } > @Test > public void threeTest() { > Threads.sleep(14000); > } > @Test > public void fourTest() { > Threads.sleep(14000); > } > @Test > public void fiveTest() { > Threads.sleep(14000); > } > } -- This message was sent by Atlassian JIRA (v7.6.3#76005)