mozilla-services/android-sync — pull request #263 by ncalexan (2012-10-16 21:16:24+00:00)
Title: Bug 802284, Bug 718057 - parameterize test port

For a few weeks now, we've had intermittent Jenkins failures. I believe they are caused by resource contention beween the `sync-android` and `sync-android-retest` branches: both test suites bind to port 15325, and the resulting races lead to BindExceptions. This PR address them.

It protects against same-process resource contention by only allowing one `HTTPServerTestHelper` to be active at once, and throwing helpful stack traces telling you where an existing server was created.

It protects against inter-process resource contention by adding a system property for specifying the test port that can be easily configured in Jenkins.

I have pushed this to `sync-android-retest`. The following unsuccessful builds used the same port:

https://ci.mozilla.org/job/sync-android/651/
https://ci.mozilla.org/job/sync-android-retest/88/

The following successful builds used different ports:

https://ci.mozilla.org/job/sync-android/651/
https://ci.mozilla.org/job/sync-android-retest/88/

I have now configured the two Jenkins jobs to *not* conflict, and set them to build every hour. This should give plenty of data to verify that this is indeed the issue, and that this PR fixes it. Let's land this ASAP.