Use only loopback addresses in acceptance tests
Buggy builds of OpenJDK do not like hosts with very long host names, and can crash in some environments. Diffy Cuckoo the Deckard based auto-verifier for Gerrit on Google Compute Engine is unable to run unit tests due to the JVM disliking the autoassigned host name. Hardcode the loopback address for all unit tests. This also isolates tests from temporary IP address changes, e.g. roaming between different WiFi networks. Change-Id: Id462d5bc3dddcb3b761239bb2be44e3ccfd05f3f
This commit is contained in:
parent
5d91ce959e
commit
c2f0efb2d1
@ -170,15 +170,7 @@ public class GerritServer {
|
||||
}
|
||||
|
||||
private static InetAddress getLocalHost() throws UnknownHostException {
|
||||
try {
|
||||
return InetAddress.getLocalHost();
|
||||
} catch (UnknownHostException e1) {
|
||||
try {
|
||||
return InetAddress.getByName("localhost");
|
||||
} catch (UnknownHostException e2) {
|
||||
return InetAddress.getByName("127.0.0.1");
|
||||
}
|
||||
}
|
||||
return InetAddress.getLoopbackAddress();
|
||||
}
|
||||
|
||||
private File sitePath;
|
||||
|
Loading…
Reference in New Issue
Block a user