Sounds like it would improve the results, but not necessarily fix, BindException @Flaky test failures. Even after n number of retries we’d still not be sure of finding the requested port available. Has any testing been done to find a point of diminishing returns on increasing the retry count?
Ken > On Jul 29, 2016, at 1:21 PM, Kirk Lund <kl...@pivotal.io> wrote: > > Many of our flaky tests are flaky because they use AvailablePort or > AvailablePortHelper to find randomly available ports. They then later fail > with a BindException because the port is already in use by the time the > test uses it. > > Here's a proposal for a temporary fix: > > The module geode-junit contains a JUnit 4 rule called RetryRule. We could > modify RetryRule to only retry if a BindException (or configurable > exception/s) is detected. This rule would then be dropped into every test > that uses AvailablePort or AvailablePortHelper. Then if the test fails with > a BindException, it would automatically retry (once or twice or whatever we > decide to configure RetryRule with). If the test fails without any detected > BindException, then it would just fail without retrying. > > Opinions on this? > > Thanks, > Kirk