H2DataStoreFactoryTest.testTCP can fail if another GeoTools is building on the same host. This test assumes that it has exclusive use of localhost. It assumes that nothing else will be using the TCP ports it likes and it can test for their availability by connecting to them. These assumptions are incorrect. Because this test can fail on 2.7.x when trunk is building, I suspect that trunk will also be affected by the same problem. The two branches are inadvertently communicating via the network.
Tests that use network resources should be subclasses of OnlineTestCase.