You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Bertrand Delacretaz (JIRA)" <ji...@apache.org> on 2013/10/28 17:26:36 UTC

[jira] [Created] (SLING-3212) JUnit retry Rule, for integration tests mostly

Bertrand Delacretaz created SLING-3212:
------------------------------------------

             Summary: JUnit retry Rule, for integration tests mostly
                 Key: SLING-3212
                 URL: https://issues.apache.org/jira/browse/SLING-3212
             Project: Sling
          Issue Type: New Feature
          Components: Testing
            Reporter: Bertrand Delacretaz
            Assignee: Bertrand Delacretaz
            Priority: Minor


Some of our integration tests have been randomly failing from time to time, and with the move to Oak which has slightly different reaction times, especially in JCR observation, this is a more obvious problem. 

Those tests usually assume that changing things in Sling has immediate effects, and this is not always the case, while uploading or changing scripts or configurations for example. There might be slight delays which are not problematic in real use, but can make such tests fail. Retrying the tests, with a small configurable delay between retries, should take care of those problems.

I'll attach a prototype JUnit Rule that enables test retries by just instantiating the Rule in the test and adding an @Rule annotation to methods that need it.

My current plan is to add this Rule to our commons/testing module, and we'll also need to slightly rework our base test classes to make them usable in JUnit4-style tests, which is required to use Rules.



--
This message was sent by Atlassian JIRA
(v6.1#6144)