zentol commented on a change in pull request #7327: [FLINK-11180][tests] Fix
ProcessFailureCancelingITCase.testCancelingOnProcessFailure error by specifying
a free port
URL: https://github.com/apache/flink/pull/7327#discussion_r242546666
##########
File path:
flink-tests/src/test/java/org/apache/flink/test/recovery/ProcessFailureCancelingITCase.java
##########
@@ -331,4 +337,17 @@ private void printProcessLog(String processName, String
log) {
System.out.println(" END SPAWNED PROCESS LOG");
System.out.println("-----------------------------------------");
}
+
+ private int findFreePort(int startPort, int range) {
+ for (int p = startPort; p < startPort + range; ++p) {
+ try {
+ new ServerSocket(p).close();
Review comment:
this is not a safe way to determine free ports, as they can still be claimed
by another process after this method returns and before we claim it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services