Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1394#discussion_r45733147
  
    --- Diff: flink-core/src/test/java/org/apache/flink/util/NetUtilsTest.java 
---
    @@ -94,4 +99,53 @@ public void testIPv6URLEncoding() {
                        fail(e.getMessage());
                }
        }
    +
    +   @Test
    +   public void testFreePortRangeUtility() {
    +           // inspired by Hadoop's example for 
"yarn.app.mapreduce.am.job.client.port-range"
    +           String rangeDefinition = "50000-50050, 50100-50200,51234 "; // 
this also contains some whitespaces
    +           Set<Integer> ports = 
NetUtils.getPortRangeFromString(rangeDefinition);
    +           Assert.assertEquals(51+101+1, ports.size());
    +           // check first range
    +           Assert.assertThat(ports, hasItems(50000, 50001, 50002, 50050));
    --- End diff --
    
    What if `ports` does not contain `50003`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to