hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "stack (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-15915) Set timeouts on hanging tests
Date Tue, 31 May 2016 04:14:12 GMT

    [ https://issues.apache.org/jira/browse/HBASE-15915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15307168#comment-15307168
] 

stack commented on HBASE-15915:
-------------------------------

What is: "In some places, we have @Rule Timeout but it actually sets timeout for atomic tests."
from description? I don't follow.

Offlist, @appy explained to me that

@ClassRule
  public static final TestRule timeout = CategoryBasedTimeout.forClass(<test_class>);

... adds the timeout for the whole class run.

He'll add release note here and some doc to refguide on how to set timeouts for unit tests
(both @ClassRule and @Rule ... let me help here @appy because I should have doc'd @Rule ....
Always meant to add that we should include following on all new unit tests..


@Rule public TestName testName = new TestName();
@Rule public final TestRule timeout =   CategoryBasedTimeout.builder().withTimeout(this.getClass()).
      withLookingForStuckThread(true).build();





> Set timeouts on hanging tests
> -----------------------------
>
>                 Key: HBASE-15915
>                 URL: https://issues.apache.org/jira/browse/HBASE-15915
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: Appy
>            Assignee: Appy
>         Attachments: HBASE-15915.master.001.patch, HBASE-15915.master.002.patch
>
>
> - We annotate tests as Small/Medium/Large and define time limits for each, we should
use them so tests fail fast and we can run Flaky-Tests job more frequently.
> - It'll be hard to do so for all existing tests (1200+ Test*.java files), but I'd like
to do it for at least those known to hang up. (Found by using report-flakies.py on TRUNK)
> - In some places, we have @Rule Timeout but it actually sets timeout for atomic tests.
> Basically we can't go the way where we define time limits on class level (Small/Medium/Large
tests) and try to enforce timeouts on atomic tests level. It would be painful (probably why
no one has done it yet).
> So i'll be changing these timeouts to
> {noformat}
> @ClassRule
>   public static final TestRule timeout = CategoryBasedTimeout.forClass(<test_class>);
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message