ajschmidt commented on a change in pull request #3920: Fix fragile unit test in NetworkNodeUnitTest URL: https://github.com/apache/trafficcontrol/pull/3920#discussion_r323926904
########## File path: traffic_router/core/src/test/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNodeUnitTest.java ########## @@ -188,7 +188,7 @@ public void itRejectsInvalidIpV4Network() throws Exception { "\"customerName\": \"Kabletown\"," + "\"coverageZones\": {" + "\"us-co-denver\": {" + - "\"network\": [\"192.168.55.258/24\",\"192.168.6.0/24\",\"192.168.0.0/16\"]," + + "\"network\": [\"192.168.55.0/40\",\"192.168.6.0/24\",\"192.168.0.0/16\"]," + Review comment: Yes. This is a good resolution. It is a negative test, expecting the code to detect the invalid IP address and return a 'null' as the response. The problem with the '258' address is that the code actually interprets it as a hostname instead of an IP and it goes down the hostname checking code path that, under certain rare environmental conditions, can actually end up getting resolved, returning an unwanted positive. The bogus mask length trips an error condition right away in the IP validation portion of the code and always produces the desired result regardless of the environment. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services