sbabcoc / JUnit-Foundation

JUnit Foundation is a lightweight collection of JUnit watchers, interfaces, and static utility classes that supplement and augment the functionality provided by the JUnit API.
Apache License 2.0
22 stars 6 forks source link

Automatic retry mechanism is incompatible with the Theories runner #101

Closed sbabcoc closed 3 years ago

sbabcoc commented 3 years ago

Enabling automatic retry with tests that are parameterized with the Theories runner results in bad behavior. The solution is to factor out the core of RetryHandler.runChildWithRetry(), passing in the statement that gets stashed away by the "theory catalyst" of the MethodBlock class. This will fix the incompatibility, and will also eliminate a bunch of redundant code in the RunWithCompleteAssignment class.

Note that the RunChild interceptor must be cognizant of the Theories runner, foregoing redirection of execution to the retry handle at this point to avoid attempting to retry the entire set of method permutations.

sbabcoc commented 3 years ago

The problems ran deeper than the Theories runner.