unclebob/fitnesse — pull request #61 by idcmp (2012-02-06 19:31:37+00:00)
Title: Override slim.port with a system property.

Previously, a change was introduced to allowed for developers specify a TCP port for Slim to run on: https://github.com/konstantinvlasenko/fitnesse/commit/ea12c90ed084874d62756daa8d93ff32665c9d93#diff-3

On a CI server however, this introduces a race condition. The first VM1 checks and discovers port P1 is free, stores this in a variable. VM2 starts up slightly later and performs the same check. At this point VM1 has already freed P1 and therefore VM2 picks P1 as well.

Generally, VM1 will call isConnected() and allocate P1 for the remainder of its test. VM2 will attempt to allocate P1, but it will fail with BindException (which would cause intermittent failures in CI - except the BindException is swallowed and the CI job passes).

This is a tiny change where we can pass in -Dslim.port=## and that will be used instead. This is consistent with using org.codehaus.mojo:build-helper-maven-plugin:reserve-network-port to reserve a port in CI, freeing the tester from caring about the environment it's running in.