Details
-
New Feature
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
Commons Testing 2.0.14
-
None
Description
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.
Attachments
Attachments
Issue Links
- blocks
-
SLING-2788 Optionally run Sling on Apache OAK
- Resolved
- is related to
-
SLING-3215 Use RetryRule in integration tests to avoid timing-related issues
- Resolved