Github user jaredjstewart commented on a diff in the pull request: https://github.com/apache/geode/pull/724#discussion_r134075704 --- Diff: geode-core/src/test/java/org/apache/geode/internal/process/lang/AvailablePidTest.java --- @@ -100,7 +105,53 @@ public void findAvailablePidsShouldReturnNoDuplicatedPids() throws Exception { assertThatNoPidIsDuplicated(availablePid.findAvailablePids(8)); } - private void assertThatNoPidIsDuplicated(int[] pids) { + @Test(timeout = DEFAULT_TIMEOUT_MILLIS) + public void findAvailablePidShouldReturnGreaterThanOrEqualToLowerBound() throws Exception { + availablePid = new AvailablePid(new AvailablePid.Bounds(1, 3)); + + int pid = availablePid.findAvailablePid(); + + assertThat(pid).isGreaterThanOrEqualTo(1); --- End diff -- I wonder if trying random values for some time period (like the awaitility tests below) might be more robust: ``` availablePid = new AvailablePid(new AvailablePid.Bounds(1, 3)); com.google.common.base.Stopwatch stopwatch = Stopwatch.createStarted(); while (stopwatch.elapsed(TimeUnit.SECONDS) < 10) { int pid = availablePid.findAvailablePid(); assertThat(pid).isLessThanOrEqualTo(3); }
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---