You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by uce <gi...@git.apache.org> on 2015/09/22 16:07:54 UTC

[GitHub] flink pull request: [tests] Add RetryOnFailure annotation

GitHub user uce opened a pull request:

    https://github.com/apache/flink/pull/1167

    [tests] Add RetryOnFailure annotation

    Yesterday I was looking into ways to automatically retry selective tests, which are known to be unstable on the CI service. This PR adds a small utility for this.
    
    ```java
    public class YourTest {
    
        @Rule
        public RetryRule retryRule = new RetryRule();
    
        @Test
        @RetryOnFailure(times=1)
        public void yourTest() {
            // This will be retried 1 time (total runs 2) before failing the test.
            throw new Exception("Failing test");
        }
    }
    ```
    
    @tillrohrmann and @rmetzger have worked on build stability lately. Do you think this is useful? Is there a test for which you would use this? If you don't think so, close this. I don't think we should add unused "utilities".

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/uce/flink retry

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/1167.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1167
    
----
commit 9a5ea66dd75214de602b6121719fe722c922fa3a
Author: Ufuk Celebi <uc...@apache.org>
Date:   2015-09-21T19:23:04Z

    [tests] Add RetryOnFailure annotation

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [tests] Add RetryOnFailure annotation

Posted by tillrohrmann <gi...@git.apache.org>.
Github user tillrohrmann commented on the pull request:

    https://github.com/apache/flink/pull/1167#issuecomment-142530433
  
    We could also fuse the TestLogger and TestRetry into a TestRules class
    which contains all the utility test rules. This would solve the problem of
    multiple inheritance.
    ​
    
    On Wed, Sep 23, 2015 at 9:58 AM, Max <no...@github.com> wrote:
    
    > Cool. This will get rid off the while (notFailed && numRetries <
    > maxRetries) { .. } test expressions.
    >
    > I would keep the TestRetry class. It is nice syntactic sugar like the
    > TestLogger. But no need to delay merging this if you're unsure.
    >
    > —
    > Reply to this email directly or view it on GitHub
    > <https://github.com/apache/flink/pull/1167#issuecomment-142523919>.
    >



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [tests] Add RetryOnFailure annotation

Posted by mxm <gi...@git.apache.org>.
Github user mxm commented on the pull request:

    https://github.com/apache/flink/pull/1167#issuecomment-142584255
  
    @tillrohrmann Good idea.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [tests] Add RetryOnFailure annotation

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the pull request:

    https://github.com/apache/flink/pull/1167#issuecomment-142309681
  
    Very nice convenience addition.
    
    Not sure if the `TestRetry` class is needed, adding the rule seems simple enough.
    
    Otherwise, +1 to merge!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [tests] Add RetryOnFailure annotation

Posted by uce <gi...@git.apache.org>.
Github user uce commented on the pull request:

    https://github.com/apache/flink/pull/1167#issuecomment-142431546
  
    OK, nice. I've added the `TestRetry` class to have it in line with the `TestLogger` rule. But I'm fine with removing it. I guess most tests, which need the retry rule will need the logger rule as well and you cannot inherit from both anyways.
    
    I will merge this w/o `TestRetry`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [tests] Add RetryOnFailure annotation

Posted by mxm <gi...@git.apache.org>.
Github user mxm commented on the pull request:

    https://github.com/apache/flink/pull/1167#issuecomment-142523919
  
    Cool. This will get rid off the `while (notFailed && numRetries < maxRetries) { .. }` test expressions.
    
    I would keep the `TestRetry` class. It is nice syntactic sugar like the `TestLogger`. But no need to delay merging this if you're unsure.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [tests] Add RetryOnFailure annotation

Posted by tillrohrmann <gi...@git.apache.org>.
Github user tillrohrmann commented on the pull request:

    https://github.com/apache/flink/pull/1167#issuecomment-142342583
  
    I like it as well a lot :-) +1
    
    On Tue, Sep 22, 2015 at 4:45 PM, Stephan Ewen <no...@github.com>
    wrote:
    
    > Very nice convenience addition.
    >
    > Not sure if the TestRetry class is needed, adding the rule seems simple
    > enough.
    >
    > Otherwise, +1 to merge!
    >
    > —
    > Reply to this email directly or view it on GitHub
    > <https://github.com/apache/flink/pull/1167#issuecomment-142309681>.
    >



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [tests] Add RetryOnFailure annotation

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/flink/pull/1167


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---